diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_traceback.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 51fb9e6..1b9e2f8 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -118,7 +118,11 @@ def test(): err = traceback.format_exception_only(X, X()) self.assertEqual(len(err), 1) str_value = '<unprintable %s object>' % X.__name__ - self.assertEqual(err[0], "%s: %s\n" % ( X.__name__, str_value)) + if X.__module__ in ('__main__', '__builtin__'): + str_name = X.__name__ + else: + str_name = '.'.join([X.__module__, X.__name__]) + self.assertEqual(err[0], "%s: %s\n" % (str_name, str_value)) def test_without_exception(self): err = traceback.format_exception_only(None, None) |