Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
Apparently this was introduced with r51625 : r51625 | guido.van.rossum | 2006-08-26 16:37:44 -0400 (Sat, 26 Aug 2006) | 4 lines Inspired by SF patch #860326, make the exception formatting by traceback.py be closer to the built-in formatting. A few unittests had to be fixed, too. ------------------------------------------------------------------------ When doctest is imported as __main__, traceback does not prepend UnexpectedException with doctest. prefix. Attached patch fixes the issue by explicitly reimporting doctest in the 'if __name__ == "__main__":' clause. This is rather inelegant and a better solution would probably be to use python -m doctest for something other than self test. For example, running doctest.testfile on command line arguments would be a reasonable use, but python -m doctest Lib/doctest.py may still have a problem. ---------- keywords: +patch nosy: +belopolsky Added file: http://bugs.python.org/file15380/issue7376.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7376> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com