summaryrefslogtreecommitdiffstats
path: root/Lib/pkgutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pkgutil.py')
-rw-r--r--Lib/pkgutil.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index 58cccdc..e42b6eb 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -461,6 +461,8 @@ def get_loader(module_or_name):
loader = getattr(module, '__loader__', None)
if loader is not None:
return loader
+ if getattr(module, '__spec__', None) is None:
+ return None
fullname = module.__name__
else:
fullname = module_or_name