@@ -215,19 +215,13 @@ refchain_fini(PyInterpreterState *interp)
215215bool
216216_PyRefchain_IsTraced (PyInterpreterState * interp ,PyObject * obj )
217217{
218- if (!has_own_refchain (interp )) {
219- interp = _PyInterpreterState_Main ();
220- }
221218return (_Py_hashtable_get (REFCHAIN (interp ),obj )== REFCHAIN_VALUE );
222219}
223220
224221
225222static void
226223_PyRefchain_Trace (PyInterpreterState * interp ,PyObject * obj )
227224{
228- if (!has_own_refchain (interp )) {
229- interp = _PyInterpreterState_Main ();
230- }
231225if (_Py_hashtable_set (REFCHAIN (interp ),obj ,REFCHAIN_VALUE )< 0 ) {
232226// Use a fatal error because _Py_NewReference() cannot report
233227// the error to the caller.
@@ -239,9 +233,6 @@ _PyRefchain_Trace(PyInterpreterState *interp, PyObject *obj)
239233static void
240234_PyRefchain_Remove (PyInterpreterState * interp ,PyObject * obj )
241235{
242- if (!has_own_refchain (interp )) {
243- interp = _PyInterpreterState_Main ();
244- }
245236void * value = _Py_hashtable_steal (REFCHAIN (interp ),obj );
246237#ifndef NDEBUG
247238assert (value == REFCHAIN_VALUE );
@@ -2587,9 +2578,6 @@ _Py_PrintReferences(PyInterpreterState *interp, FILE *fp)
25872578interp = _PyInterpreterState_Main ();
25882579 }
25892580fprintf (fp ,"Remaining objects:\n" );
2590- if (!has_own_refchain (interp )) {
2591- interp = _PyInterpreterState_Main ();
2592- }
25932581_Py_hashtable_foreach (REFCHAIN (interp ),_Py_PrintReference ,fp );
25942582}
25952583
@@ -2618,9 +2606,6 @@ void
26182606_Py_PrintReferenceAddresses (PyInterpreterState * interp ,FILE * fp )
26192607{
26202608fprintf (fp ,"Remaining object addresses:\n" );
2621- if (!has_own_refchain (interp )) {
2622- interp = _PyInterpreterState_Main ();
2623- }
26242609_Py_hashtable_foreach (REFCHAIN (interp ),_Py_PrintReferenceAddress ,fp );
26252610}
26262611
@@ -2700,9 +2685,6 @@ _Py_GetObjects(PyObject *self, PyObject *args)
27002685 .limit = limit ,
27012686 };
27022687PyInterpreterState * interp = _PyInterpreterState_GET ();
2703- if (!has_own_refchain (interp )) {
2704- interp = _PyInterpreterState_Main ();
2705- }
27062688int res = _Py_hashtable_foreach (REFCHAIN (interp ),_Py_GetObject ,& data );
27072689if (res == _PY_GETOBJECTS_ERROR ) {
27082690Py_DECREF (list );