MCPcopy Create free account
hub / github.com/numpy/numpy / exec_mod_from_location

Function exec_mod_from_location

numpy/distutils/misc_util.py:2484–2493  ·  view source on GitHub ↗

Use importlib machinery to import a module `modname` from the file `modfile`. Depending on the `spec.loader`, the module may not be registered in sys.modules.

(modname, modfile)

Source from the content-addressed store, hash-verified

2482
2483
2484def exec_mod_from_location(modname, modfile):
2485 '''
2486 Use importlib machinery to import a module `modname` from the file
2487 `modfile`. Depending on the `spec.loader`, the module may not be
2488 registered in sys.modules.
2489 '''
2490 spec = importlib.util.spec_from_file_location(modname, modfile)
2491 foo = importlib.util.module_from_spec(spec)
2492 spec.loader.exec_module(foo)
2493 return foo

Callers 6

configurationFunction · 0.90
rundocsFunction · 0.90
dist_load_moduleMethod · 0.85
get_versionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected