Buglet: fix unittest.main()

This commit is contained in:
Antoine Pitrou 2009-01-09 19:29:16 +00:00
parent 0560843b8f
commit e7bd868429

View file

@ -813,7 +813,7 @@ Examples:
def __init__(self, module='__main__', defaultTest=None, def __init__(self, module='__main__', defaultTest=None,
argv=None, testRunner=TextTestRunner, argv=None, testRunner=TextTestRunner,
testLoader=defaultTestLoader): testLoader=defaultTestLoader):
if isinstance(module, basestring): if isinstance(module, str):
self.module = __import__(module) self.module = __import__(module)
for part in module.split('.')[1:]: for part in module.split('.')[1:]:
self.module = getattr(self.module, part) self.module = getattr(self.module, part)