File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ def raise1():
23
23
def raise2 ():
24
24
raise SystemError
25
25
26
+ def exit ():
27
+ raise SystemExit
28
+
26
29
27
30
class GeneralTest (unittest .TestCase ):
28
31
@@ -76,6 +79,13 @@ def test_raise_unnormalized(self):
76
79
self .assertRaises (ZeroDivisionError , atexit ._run_exitfuncs )
77
80
self .assertIn ("ZeroDivisionError" , self .stream .getvalue ())
78
81
82
+ def test_exit (self ):
83
+ # be sure a SystemExit is handled properly
84
+ atexit .register (exit )
85
+
86
+ self .assertRaises (SystemExit , atexit ._run_exitfuncs )
87
+ self .assertEqual (self .stream .getvalue (), '' )
88
+
79
89
def test_print_tracebacks (self ):
80
90
# Issue #18776: the tracebacks should be printed when errors occur.
81
91
def f ():
Original file line number Diff line number Diff line change @@ -355,6 +355,9 @@ Extension Modules
355
355
Library
356
356
-------
357
357
358
+ - bpo-28994: The traceback no longer displayed for SystemExit raised in
359
+ a callback registered by atexit.
360
+
358
361
- bpo-11822: The dis.dis() function now is able to disassemble nested
359
362
code objects.
360
363
You can’t perform that action at this time.
0 commit comments