diff options
author | Thomas A Caswell <tcaswell@gmail.com> | 2019-08-29 16:30:04 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-08-29 16:30:04 (GMT) |
commit | e278335a6eb049e6028db9a8dcb8baac6cb365ee (patch) | |
tree | 07f82d9cd0ba01c8709a6a3697047cfa8f7ff44c /Lib/test/test_faulthandler.py | |
parent | 88ea166dadb8aeb34541a0a464662dea222629e5 (diff) | |
download | cpython-e278335a6eb049e6028db9a8dcb8baac6cb365ee.zip cpython-e278335a6eb049e6028db9a8dcb8baac6cb365ee.tar.gz cpython-e278335a6eb049e6028db9a8dcb8baac6cb365ee.tar.bz2 |
bpo-37933: Fix faulthandler.cancel_dump_traceback_later() (GH-15440)
Fix faulthandler.cancel_dump_traceback_later() call
if cancel_dump_traceback_later() was not called previously.
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r-- | Lib/test/test_faulthandler.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index 1cf20db..b1aa8c3 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -817,6 +817,17 @@ class FaultHandlerTests(unittest.TestCase): self.assertEqual(output, []) self.assertEqual(exitcode, 0xC0000005) + def test_cancel_later_without_dump_traceback_later(self): + # bpo-37933: Calling cancel_dump_traceback_later() + # without dump_traceback_later() must not segfault. + code = dedent(""" + import faulthandler + faulthandler.cancel_dump_traceback_later() + """) + output, exitcode = self.get_output(code) + self.assertEqual(output, []) + self.assertEqual(exitcode, 0) + if __name__ == "__main__": unittest.main() |