MCPcopy Index your code
hub / github.com/RustPython/RustPython / _gcd_import

Function _gcd_import

Lib/importlib/_bootstrap.py:1386–1398  ·  view source on GitHub ↗

Import and return the module based on its name, the package the call is being made from, and the level adjustment. This function represents the greatest common denominator of functionality between import_module and __import__. This includes setting __package__ if the loader did not.

(name, package=None, level=0)

Source from the content-addressed store, hash-verified

1384
1385
1386def _gcd_import(name, package=None, level=0):
1387 """Import and return the module based on its name, the package the call is
1388 being made from, and the level adjustment.
1389
1390 This function represents the greatest common denominator of functionality
1391 between import_module and __import__. This includes setting __package__ if
1392 the loader did not.
1393
1394 """
1395 _sanity_check(name, package, level)
1396 if level > 0:
1397 name = _resolve_name(name, package, level)
1398 return _find_and_load(name, _gcd_import)
1399
1400
1401def _handle_fromlist(module, fromlist, import_, *, recursive=False):

Callers 1

__import__Function · 0.70

Calls 3

_sanity_checkFunction · 0.70
_resolve_nameFunction · 0.70
_find_and_loadFunction · 0.70

Tested by

no test coverage detected