MCPcopy Index your code
hub / github.com/python/cpython / getmodule

Function getmodule

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

Source from the content-addressed store, hash-verified

599 return module, name
600
601def getmodule(module):
602 try:
603 return sys.modules[module]
604 except KeyError:
605 try:
606 with warnings.catch_warnings():
607 action = 'always' if support.verbose else 'ignore'
608 warnings.simplefilter(action, DeprecationWarning)
609 __import__(module)
610 except AttributeError as exc:
611 if support.verbose:
612 print("Can't import module %r: %s" % (module, exc))
613 raise ImportError
614 except ImportError as exc:
615 if support.verbose:
616 print(exc)
617 raise
618 return sys.modules[module]
619
620def getattribute(module, name):
621 obj = getmodule(module)

Callers 5

getattributeFunction · 0.70
test_importMethod · 0.70
test_import_mappingMethod · 0.70
test_getmoduleMethod · 0.50

Calls 1

__import__Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…