diff options
author | Guido van Rossum <guido@python.org> | 1998-12-22 13:44:01 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-12-22 13:44:01 (GMT) |
commit | fdd302820ec8f8af0baa3e58a2795d00f14dffcb (patch) | |
tree | 85e115a295373423970c58cd86d9d6015bb19571 | |
parent | f96cff2c822d32f92050a733c331636d16d545ed (diff) | |
download | cpython-fdd302820ec8f8af0baa3e58a2795d00f14dffcb.zip cpython-fdd302820ec8f8af0baa3e58a2795d00f14dffcb.tar.gz cpython-fdd302820ec8f8af0baa3e58a2795d00f14dffcb.tar.bz2 |
Fix for modulefinder so that it prints all modules an unknown module
was referenced in instead of only the last. (Sjoerd Mullender)
-rw-r--r-- | Tools/freeze/modulefinder.py | 8 |
1 files 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: |