File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -106,15 +106,13 @@ def find_spec(
106
106
path : Optional [Sequence [str ]],
107
107
target : Optional [ModuleType ] = None ,
108
108
) -> Optional [ModuleSpec ]:
109
- module_spec = PathFinder .find_spec (fullname , path , target )
110
- if not module_spec or not module_spec .origin :
111
- return module_spec
109
+ if any (re .match (pattern , fullname ) for pattern in LAZY_MODULES ):
110
+ module_spec = PathFinder .find_spec (fullname , path , target )
111
+ if not module_spec or not module_spec .origin :
112
+ return
112
113
113
- if module_spec and any (
114
- re .match (pattern , module_spec .name ) for pattern in LAZY_MODULES
115
- ):
116
114
module_spec .loader = LazyModuleLoader (module_spec .name , module_spec .origin )
117
- return module_spec
115
+ return module_spec
118
116
119
117
120
118
def apply ():
You can’t perform that action at this time.
0 commit comments