diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-05-12 10:49:13 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-05-12 10:49:13 (GMT) |
commit | f596a5125a50c8e2026984531e9be3fc111b3d49 (patch) | |
tree | 960e3db9021da912efabc927232ea67e68b0475a | |
parent | 7df82c9ef85fdcb0d7f4208d8ae1633959941e8e (diff) | |
download | cpython-f596a5125a50c8e2026984531e9be3fc111b3d49.zip cpython-f596a5125a50c8e2026984531e9be3fc111b3d49.tar.gz cpython-f596a5125a50c8e2026984531e9be3fc111b3d49.tar.bz2 |
Better fix for modules using unittest.main(). Fixes regression caused by commit for issue 5995. Michael Foord
-rw-r--r-- | Lib/unittest.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py index d781354..5858d89 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py @@ -1567,7 +1567,7 @@ Examples: return if len(args) > 0: self.testNames = args - if os.path.splitext(os.path.basename(__file__))[0] == 'unitest': + if sys.modules['unittest'] is sys.modules['__main__']: self.module = None else: self.testNames = (self.defaultTest,) |