From fdd302820ec8f8af0baa3e58a2795d00f14dffcb Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 22 Dec 1998 13:44:01 +0000 Subject: Fix for modulefinder so that it prints all modules an unknown module was referenced in instead of only the last. (Sjoerd Mullender) --- Tools/freeze/modulefinder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/freeze/modulefinder.py b/Tools/freeze/modulefinder.py index 5c05c3a..c285787 100644 --- a/Tools/freeze/modulefinder.py +++ b/Tools/freeze/modulefinder.py @@ -280,7 +280,9 @@ class ModuleFinder: self.import_hook(name, m) except ImportError, msg: self.msg(2, "ImportError:", str(msg)) - self.badmodules[name] = {m.__name__:None} + if not self.badmodules.has_key(name): + self.badmodules[name] = {} + self.badmodules[name][m.__name__] = None elif op == IMPORT_FROM: name = co.co_names[oparg] assert lastname is not None @@ -290,7 +292,9 @@ class ModuleFinder: except ImportError, msg: self.msg(2, "ImportError:", str(msg)) fullname = lastname + "." + name - self.badmodules[fullname] = {m.__name__:None} + if not self.badmodules.has_key(fullname): + self.badmodules[fullname] = {} + self.badmodules[fullname][m.__name__] = None else: lastname = None for c in co.co_consts: -- cgit v0.12