mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-135729: Store reference to globals in Interpreter._decref (GH-139104) (GH-139112)
* gh-135729: Store reference to globals in `Interpreter._decref` (GH-139104)
(cherry picked from commit 571210b8f3)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
parent
5b64b59618
commit
070993b8ad
3 changed files with 24 additions and 2 deletions
|
|
@ -419,6 +419,21 @@ def test_pickle(self):
|
|||
unpickled = pickle.loads(data)
|
||||
self.assertEqual(unpickled, interp)
|
||||
|
||||
@support.requires_subprocess()
|
||||
@force_not_colorized
|
||||
def test_cleanup_in_repl(self):
|
||||
# GH-135729: Using a subinterpreter in the REPL would lead to an unraisable
|
||||
# exception during finalization
|
||||
repl = script_helper.spawn_python("-i")
|
||||
script = b"""if True:
|
||||
from concurrent import interpreters
|
||||
interpreters.create()
|
||||
exit()"""
|
||||
stdout, stderr = repl.communicate(script)
|
||||
self.assertIsNone(stderr)
|
||||
self.assertNotIn(b"Traceback", stdout)
|
||||
|
||||
|
||||
|
||||
class TestInterpreterIsRunning(TestBase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue