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

Method find_spec

Lib/test/test_importlib/extension/test_finder.py:22–45  ·  view source on GitHub ↗
(self, fullname)

Source from the content-addressed store, hash-verified

20 )
21
22 def find_spec(self, fullname):
23 if is_apple_mobile:
24 # Apple mobile platforms require a specialist loader that uses
25 # .fwork files as placeholders for the true `.so` files.
26 loaders = [
27 (
28 self.machinery.AppleFrameworkLoader,
29 [
30 ext.replace(".so", ".fwork")
31 for ext in self.machinery.EXTENSION_SUFFIXES
32 ]
33 )
34 ]
35 else:
36 loaders = [
37 (
38 self.machinery.ExtensionFileLoader,
39 self.machinery.EXTENSION_SUFFIXES
40 )
41 ]
42
43 importer = self.machinery.FileFinder(util.EXTENSIONS.path, *loaders)
44
45 return importer.find_spec(fullname)
46
47 def test_module(self):
48 self.assertTrue(self.find_spec(util.EXTENSIONS.name))

Callers 12

test_moduleMethod · 0.95
test_failureMethod · 0.95
_findMethod · 0.45
_findMethod · 0.45
findMethod · 0.45
test_moduleMethod · 0.45
test_failureMethod · 0.45
findMethod · 0.45
test_not_using_frozenMethod · 0.45
test_unloadableMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45

Calls 2

find_specMethod · 0.95
replaceMethod · 0.45

Tested by

no test coverage detected