summaryrefslogtreecommitdiffstats
path: root/Lib/modulefinder.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/modulefinder.py')
-rw-r--r--Lib/modulefinder.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index e4184a1..989172a 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -310,7 +310,10 @@ class ModuleFinder:
def _add_badmodule(self, name, caller):
if name not in self.badmodules:
self.badmodules[name] = {}
- self.badmodules[name][caller.__name__] = 1
+ if caller:
+ self.badmodules[name][caller.__name__] = 1
+ else:
+ self.badmodules[name]["-"] = 1
def _safe_import_hook(self, name, caller, fromlist, level=-1):
# wrapper for self.import_hook() that won't raise ImportError