MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / subimport

Function subimport

cloudpickle/cloudpickle.py:471–477  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

469
470
471def subimport(name):
472 # We cannot do simply: `return __import__(name)`: Indeed, if ``name`` is
473 # the name of a submodule, __import__ will return the top-level root module
474 # of this submodule. For instance, __import__('os.path') returns the `os`
475 # module.
476 __import__(name)
477 return sys.modules[name]
478
479
480def dynamic_subimport(name, vars):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected