File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -290,13 +290,14 @@ def find_distributions(self, context):
290
290
def find_spec (self , fullname , path , target = None ):
291
291
for finder in self .old_meta_path :
292
292
# Consider the finder only if it implements find_spec
293
- if not getattr (finder , "find_spec" , None ):
293
+ if getattr (finder , "find_spec" , None ) is None :
294
294
continue
295
295
# Attempt to find the spec
296
296
spec = finder .find_spec (fullname , path , target )
297
297
if spec is not None :
298
- # Patch the loader to enable reloading
299
- spec .__loader__ = ImportLoader (self .watcher , spec .__loader__ )
298
+ if getattr (spec , "__loader__" , None ) is not None :
299
+ # Patch the loader to enable reloading
300
+ spec .__loader__ = ImportLoader (self .watcher , spec .__loader__ )
300
301
return spec
301
302
302
303
def find_module (self , fullname , path = None ):
You can’t perform that action at this time.
0 commit comments