gh-76785: Clean Up Interpreter ID Conversions (gh-117048)

Mostly we unify the two different implementations of the conversion code (from PyObject * to int64_t.  We also drop the PyArg_ParseTuple()-style converter function, as well as rename and move PyInterpreterID_LookUp().
This commit is contained in:
Eric Snow 2024-03-21 09:56:12 -06:00 committed by GitHub
parent e728303532
commit bbee57fa8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 143 additions and 178 deletions

View file

@ -2303,7 +2303,7 @@ class InterpreterIDTests(unittest.TestCase):
def test_linked_lifecycle(self):
id1 = _interpreters.create()
_testcapi.unlink_interpreter_refcount(id1)
_testinternalcapi.unlink_interpreter_refcount(id1)
self.assertEqual(
_testinternalcapi.get_interpreter_refcount(id1),
0)
@ -2319,7 +2319,7 @@ class InterpreterIDTests(unittest.TestCase):
_testinternalcapi.get_interpreter_refcount(id1),
0)
_testcapi.link_interpreter_refcount(id1)
_testinternalcapi.link_interpreter_refcount(id1)
self.assertEqual(
_testinternalcapi.get_interpreter_refcount(id1),
0)