File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1887,6 +1887,23 @@ def modify_file():
18871887 t .start ()
18881888 t .join ()
18891889
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+
18901907
18911908class ThreadRunFail (threading .Thread ):
18921909 def run (self ):
You can’t perform that action at this time.
0 commit comments