◐ Shell
clean mode source ↗

Message 370631 - Python tracker

The following test is enough to reproduce the leak:
---
import unittest
import _xxsubinterpreters as _interpreters

class TestInterpreterDestroy(unittest.TestCase):

    def tearDown(self):
        for interp_id in _interpreters.list_all():
            if interp_id == 0:  # main
                continue
            _interpreters.destroy(interp_id)

    def test_from_current(self):
        interp_id = _interpreters.create(isolated=True)
        _interpreters.run_string(interp_id, "import select")
---