Commits

Anonymous committed 263655c

Fix for modulefinder so that it prints all modules an unknown module
was referenced in instead of only the last. (Sjoerd Mullender)

Comments (0)

Files changed (1)

Tools/freeze/modulefinder.py

                         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
                     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: