summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 7fea2d3..a39a267 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -1523,6 +1523,37 @@ class ThreadingExceptionTests(BaseTestCase):
self.assertEqual(out, b'')
self.assertNotIn("Unhandled exception", err.decode())
+ def test_print_exception_gh_102056(self):
+ # This used to crash. See gh-102056.
+ script = r"""if True:
+ import time
+ import threading
+ import _thread
+
+ def f():
+ try:
+ f()
+ except RecursionError:
+ f()
+
+ def g():
+ try:
+ raise ValueError()
+ except* ValueError:
+ f()
+
+ def h():
+ time.sleep(1)
+ _thread.interrupt_main()
+
+ t = threading.Thread(target=h)
+ t.start()
+ g()
+ t.join()
+ """
+
+ assert_python_failure("-c", script)
+
def test_bare_raise_in_brand_new_thread(self):
def bare_raise():
raise