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

Method find_spec

Lib/test/test_importlib/util.py:268–276  ·  view source on GitHub ↗
(self, fullname, path=None, parent=None)

Source from the content-addressed store, hash-verified

266 """Importer mock using PEP 451 APIs."""
267
268 def find_spec(self, fullname, path=None, parent=None):
269 try:
270 module = self.modules[fullname]
271 except KeyError:
272 return None
273 spec = util.spec_from_file_location(
274 fullname, module.__file__, loader=self,
275 submodule_search_locations=getattr(module, '__path__', None))
276 return spec
277
278 def create_module(self, spec):
279 if spec.name not in self.modules:

Calls

no outgoing calls