test other name variable

This commit is contained in:
Guido van Rossum 1995-06-22 18:51:23 +00:00
parent f4ef7e6a0b
commit f71c79bb85

View File

@ -341,7 +341,7 @@ def whichmodule(cls):
import sys
clsname = cls.__name__
for name, module in sys.modules.items():
if module.__name__ != '__main__' and \
if name != '__main__' and \
hasattr(module, clsname) and \
getattr(module, clsname) is cls:
break