mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #10756: atexit normalizes the exception before displaying it.
This commit is contained in:
parent
29e762c941
commit
358e11d928
3 changed files with 11 additions and 0 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue