Merged revisions 67046 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67046 | thomas.heller | 2008-10-30 21:18:13 +0100 (Do, 30 Okt 2008) | 2 lines

  Fixed a modulefinder crash on certain relative imports.
........
This commit is contained in:
Thomas Heller 2008-10-30 20:29:54 +00:00
parent b74777ed33
commit 68daeb0f85
3 changed files with 22 additions and 1 deletions

View file

@ -309,7 +309,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