Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b4b46e

Browse files
committed
Fix a bug reported by Toby Dickenson (on 18 May 1999).
Sometimes there's no parent, so don't try to get its __name__.
1 parent cfd76a2 commit 8b4b46e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Tools/freeze/modulefinder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ def import_module(self, partname, fqname, parent):
220220
return m
221221
if self.badmodules.has_key(fqname):
222222
self.msgout(3, "import_module -> None")
223-
self.badmodules[fqname][parent.__name__] = None
223+
if parent:
224+
self.badmodules[fqname][parent.__name__] = None
224225
return None
225226
try:
226227
fp, pathname, stuff = self.find_module(partname,

0 commit comments

Comments
 (0)