@@ -2576,7 +2576,7 @@ static PyInterpreterRef
25762576get_strong_ref (void )
25772577{
25782578 PyInterpreterRef ref ;
2579- if (PyInterpreterRef_Get (& ref ) < 0 ) {
2579+ if (PyInterpreterRef_FromCurrent (& ref ) < 0 ) {
25802580 Py_FatalError ("strong reference should not have failed" );
25812581 }
25822582 return ref ;
@@ -2587,10 +2587,10 @@ test_interp_ref_common(void)
25872587{
25882588 PyInterpreterState * interp = PyInterpreterState_Get ();
25892589 PyInterpreterRef ref = get_strong_ref ();
2590- assert (PyInterpreterRef_AsInterpreter (ref ) == interp );
2590+ assert (PyInterpreterRef_GetInterpreter (ref ) == interp );
25912591
25922592 PyInterpreterRef ref_2 = PyInterpreterRef_Dup (ref );
2593- assert (PyInterpreterRef_AsInterpreter (ref_2 ) == interp );
2593+ assert (PyInterpreterRef_GetInterpreter (ref_2 ) == interp );
25942594
25952595 // We can close the references in any order
25962596 PyInterpreterRef_Close (ref );
@@ -2708,7 +2708,7 @@ test_thread_state_ensure_crossinterp(PyObject *self, PyObject *unused)
27082708
27092709 PyThreadState * ensured_tstate = PyThreadState_Get ();
27102710 assert (ensured_tstate != save_tstate );
2711- assert (PyInterpreterState_Get () == PyInterpreterRef_AsInterpreter (ref ));
2711+ assert (PyInterpreterState_Get () == PyInterpreterRef_GetInterpreter (ref ));
27122712 assert (PyGILState_GetThisThreadState () == ensured_tstate );
27132713
27142714 // Now though, we should reactivate the thread state
@@ -2743,20 +2743,20 @@ test_weak_interpreter_ref_after_shutdown(PyObject *self, PyObject *unused)
27432743 return PyErr_NoMemory ();
27442744 }
27452745
2746- int res = PyInterpreterWeakRef_Get (& wref );
2746+ int res = PyInterpreterWeakRef_FromCurrent (& wref );
27472747 (void )res ;
27482748 assert (res == 0 );
27492749
27502750 // As a sanity check, ensure that the weakref actually works
27512751 PyInterpreterRef ref ;
2752- res = PyInterpreterWeakRef_AsStrong (wref , & ref );
2752+ res = PyInterpreterWeakRef_Promote (wref , & ref );
27532753 assert (res == 0 );
27542754 PyInterpreterRef_Close (ref );
27552755
27562756 // Now, destroy the interpreter and try to acquire a weak reference.
27572757 // It should fail.
27582758 Py_EndInterpreter (interp_tstate );
2759- res = PyInterpreterWeakRef_AsStrong (wref , & ref );
2759+ res = PyInterpreterWeakRef_Promote (wref , & ref );
27602760 assert (res == -1 );
27612761
27622762 PyThreadState_Swap (save_tstate );
@@ -2767,7 +2767,7 @@ static PyObject *
27672767foo (PyObject * self , PyObject * foo )
27682768{
27692769 PyInterpreterRef ref ;
2770- PyInterpreterRef_Get (& ref );
2770+ PyInterpreterRef_FromCurrent (& ref );
27712771 PyInterpreterRef_Close (ref );
27722772 Py_RETURN_NONE ;
27732773}
0 commit comments