Fix a bug reported by Toby Dickenson (on 18 May 1999).

Sometimes there's no parent, so don't try to get its __name__.
This commit is contained in:
Guido van Rossum 1999-11-02 15:46:44 +00:00
parent cfd76a202b
commit 8b4b46e4f3
1 changed files with 2 additions and 1 deletions

View File

@ -220,7 +220,8 @@ class ModuleFinder:
return m
if self.badmodules.has_key(fqname):
self.msgout(3, "import_module -> None")
self.badmodules[fqname][parent.__name__] = None
if parent:
self.badmodules[fqname][parent.__name__] = None
return None
try:
fp, pathname, stuff = self.find_module(partname,