@@ -86,9 +86,9 @@ class Finder:
86
86
def __init__ (self , path : Sequence [str ] | None = None ) -> None :
87
87
self ._path = path or sys .path
88
88
89
+ @staticmethod
89
90
@abc .abstractmethod
90
91
def find_module (
91
- self ,
92
92
modname : str ,
93
93
module_parts : Sequence [str ],
94
94
processed : list [str ],
@@ -126,8 +126,8 @@ class ImportlibFinder(Finder):
126
126
+ [(s , ModuleType .PY_COMPILED ) for s in importlib .machinery .BYTECODE_SUFFIXES ]
127
127
)
128
128
129
+ @staticmethod
129
130
def find_module (
130
- self ,
131
131
modname : str ,
132
132
module_parts : Sequence [str ],
133
133
processed : list [str ],
@@ -221,8 +221,8 @@ def contribute_to_path(
221
221
class ExplicitNamespacePackageFinder (ImportlibFinder ):
222
222
"""A finder for the explicit namespace packages."""
223
223
224
+ @staticmethod
224
225
def find_module (
225
- self ,
226
226
modname : str ,
227
227
module_parts : Sequence [str ],
228
228
processed : list [str ],
@@ -261,8 +261,8 @@ def __init__(self, path: Sequence[str]) -> None:
261
261
except zipimport .ZipImportError :
262
262
continue
263
263
264
+ @staticmethod
264
265
def find_module (
265
- self ,
266
266
modname : str ,
267
267
module_parts : Sequence [str ],
268
268
processed : list [str ],
@@ -285,8 +285,8 @@ def find_module(
285
285
class PathSpecFinder (Finder ):
286
286
"""Finder based on importlib.machinery.PathFinder."""
287
287
288
+ @staticmethod
288
289
def find_module (
289
- self ,
290
290
modname : str ,
291
291
module_parts : Sequence [str ],
292
292
processed : list [str ],
@@ -378,9 +378,7 @@ def _find_spec_with_path(
378
378
) -> tuple [Finder | _MetaPathFinder , ModuleSpec ]:
379
379
for finder in _SPEC_FINDERS :
380
380
finder_instance = finder (search_path )
381
- spec = finder_instance .find_module (
382
- modname , module_parts , processed , submodule_path
383
- )
381
+ spec = finder .find_module (modname , module_parts , processed , submodule_path )
384
382
if spec is None :
385
383
continue
386
384
return finder_instance , spec
0 commit comments