MCPcopy Create free account
hub / github.com/ipython/ipython / find_module

Method find_module

IPython/utils/shimmodule.py:31–43  ·  view source on GitHub ↗

Return self if we should be used to import the module.

(self, fullname, path=None)

Source from the content-addressed store, hash-verified

29 return self.mirror + fullname[len(self.src):]
30
31 def find_module(self, fullname, path=None):
32 """Return self if we should be used to import the module."""
33 if fullname.startswith(self.src + '.'):
34 mirror_name = self._mirror_name(fullname)
35 try:
36 mod = import_item(mirror_name)
37 except ImportError:
38 return
39 else:
40 if not isinstance(mod, types.ModuleType):
41 # not a module
42 return None
43 return self
44
45 def load_module(self, fullname):
46 """Import the mirrored module, and insert it into sys.modules"""

Callers 2

import_submoduleFunction · 0.45
deep_reload_hookFunction · 0.45

Calls 2

_mirror_nameMethod · 0.95
import_itemFunction · 0.85

Tested by

no test coverage detected