File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 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):
290290 def find_spec (self , fullname , path , target = None ):
291291 for finder in self .old_meta_path :
292292 # 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 :
294294 continue
295295 # Attempt to find the spec
296296 spec = finder .find_spec (fullname , path , target )
297297 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__ )
300301 return spec
301302
302303 def find_module (self , fullname , path = None ):
You can’t perform that action at this time.
0 commit comments