Skip to content

Commit

Permalink
Less intrusive Python import hook
Browse files Browse the repository at this point in the history
Fixes #40564
  • Loading branch information
maximlt committed Dec 12, 2020
1 parent 5deda1f commit fc02207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/utils.py
Expand Up @@ -791,7 +791,7 @@ def _import(name, globals={}, locals={}, fromlist=[], level=None):

mod = _builtin_import(name, globals, locals, fromlist, level)

if mod and '__file__' in mod.__dict__:
if mod and getattr(mod, '__file__', None):
module_name = mod.__name__ if fromlist else name
package_name = module_name.split('.')[0]
# check whether the module belongs to one of our plugins
Expand Down

0 comments on commit fc02207

Please sign in to comment.