Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/test/test_interpreters/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def test_cleanup_in_repl(self):
exit()"""
stdout, stderr = repl.communicate(script)
self.assertIsNone(stderr)
self.assertIn(b"remaining subinterpreters", stdout)
self.assertIn(b"Interpreter.close()", stdout)
self.assertNotIn(b"Traceback", stdout)

@support.requires_subprocess()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Suggest using :meth:`concurrent.interpreters.Interpreter.close` instead of the
private ``_interpreters.destroy`` function when warning about remaining subinterpreters.
Patch by Sergey Miryanov.
2 changes: 1 addition & 1 deletion Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@ finalize_subinterpreters(void)
(void)PyErr_WarnEx(
PyExc_RuntimeWarning,
"remaining subinterpreters; "
"destroy them with _interpreters.destroy()",
"close them with Interpreter.close()",
0);

/* Swap out the current tstate, which we know must belong
Expand Down
Loading