Issue #10756: atexit normalizes the exception before displaying it.

This commit is contained in:
Victor Stinner 2011-01-05 03:54:25 +00:00
parent 29e762c941
commit 358e11d928
3 changed files with 11 additions and 0 deletions

View file

@ -65,6 +65,14 @@ class TestCase(unittest.TestCase):
self.assertRaises(TypeError, atexit._run_exitfuncs)
def test_raise_unnormalized(self):
# Issue #10756: Make sure that an unnormalized exception is
# handled properly
atexit.register(lambda: 1 / 0)
self.assertRaises(ZeroDivisionError, atexit._run_exitfuncs)
self.assertIn("ZeroDivisionError", self.stream.getvalue())
def test_stress(self):
a = [0]
def inc():