We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 280f79c commit 52896bcCopy full SHA for 52896bc
1 file changed
Lib/test/test_threading.py
@@ -1887,6 +1887,23 @@ def modify_file():
1887
t.start()
1888
t.join()
1889
1890
+ def test_dummy_thread_on_interpreter_shutdown(self):
1891
+ # GH-130522: When `threading` held a reference to itself and then a
1892
+ # _DummyThread() object was created, destruction of the dummy thread
1893
+ # would emit an unraisable exception at shutdown, due to a lock being
1894
+ # destroyed.
1895
+ code = """if True:
1896
+ import sys
1897
+ import threading
1898
+
1899
+ threading.x = sys.modules[__name__]
1900
+ x = threading._DummyThread()
1901
+ """
1902
+ rc, out, err = assert_python_ok("-c", code)
1903
+ self.assertEqual(rc, 0)
1904
+ self.assertEqual(out, b"")
1905
+ self.assertEqual(err, b"")
1906
1907
1908
class ThreadRunFail(threading.Thread):
1909
def run(self):
0 commit comments