File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Lib/test/test_interpreters Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,22 @@ def test_pickle(self):
419419 unpickled = pickle .loads (data )
420420 self .assertEqual (unpickled , interp )
421421
422+ @support .requires_subprocess ()
423+ @force_not_colorized
424+ def test_cleanup_in_repl (self ):
425+ # GH-135729: Using a subinterpreter in the REPL would lead to an unraisable
426+ # exception during finalization
427+ repl = script_helper .spawn_python ("-i" )
428+ script = b"""if True:
429+ from concurrent import interpreters
430+ interpreters.create()
431+ exit()"""
432+ stdout , stderr = repl .communicate (script )
433+ self .assertIsNone (stderr )
434+ self .assertIn (b"remaining subinterpreters" , stdout )
435+ self .assertNotIn (b"Traceback" , stdout )
436+
437+
422438
423439class TestInterpreterIsRunning (TestBase ):
424440
You can’t perform that action at this time.
0 commit comments