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

Function getmodule

Lib/test/test_pickle.py:671–688  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

669 return module, name
670
671def getmodule(module):
672 try:
673 return sys.modules[module]
674 except KeyError:
675 try:
676 with warnings.catch_warnings():
677 action = 'always' if support.verbose else 'ignore'
678 warnings.simplefilter(action, DeprecationWarning)
679 __import__(module)
680 except AttributeError as exc:
681 if support.verbose:
682 print("Can't import module %r: %s" % (module, exc))
683 raise ImportError
684 except ImportError as exc:
685 if support.verbose:
686 print(exc)
687 raise
688 return sys.modules[module]
689
690def getattribute(module, name):
691 obj = getmodule(module)

Callers 4

getattributeFunction · 0.70
test_importMethod · 0.70
test_import_mappingMethod · 0.70

Calls 2

__import__Function · 0.50
printFunction · 0.50

Tested by

no test coverage detected