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

Method find_module

Lib/modulefinder.py:487–503  ·  view source on GitHub ↗
(self, name, path, parent=None)

Source from the content-addressed store, hash-verified

485 return m
486
487 def find_module(self, name, path, parent=None):
488 if parent is not None:
489 # assert path is not None
490 fullname = parent.__name__+'.'+name
491 else:
492 fullname = name
493 if fullname in self.excludes:
494 self.msgout(3, "find_module -> Excluded", fullname)
495 raise ImportError(name)
496
497 if path is None:
498 if name in sys.builtin_module_names:
499 return (None, None, ("", "", _C_BUILTIN))
500
501 path = self.path
502
503 return _find_module(name, path)
504
505 def report(self):
506 """Print a report to stdout, listing the found modules with their

Callers 2

import_moduleMethod · 0.95
load_packageMethod · 0.95

Calls 2

msgoutMethod · 0.95
_find_moduleFunction · 0.85

Tested by

no test coverage detected