@@ -138,6 +138,15 @@ pyobject_is_unique_temporary(PyObject *self, PyObject *obj)
138138 return PyLong_FromLong (result );
139139}
140140
141+ static PyObject *
142+ pyobject_is_unique_temporary_new_object (PyObject * self , PyObject * unused )
143+ {
144+ PyObject * obj = PyList_New (0 );
145+ int result = PyUnstable_Object_IsUniqueReferencedTemporary (obj );
146+ Py_DECREF (obj );
147+ return PyLong_FromLong (result );
148+ }
149+
141150static int MyObject_dealloc_called = 0 ;
142151
143152static void
@@ -517,6 +526,7 @@ static PyMethodDef test_methods[] = {
517526 {"pyobject_clear_weakrefs_no_callbacks" , pyobject_clear_weakrefs_no_callbacks , METH_O },
518527 {"pyobject_enable_deferred_refcount" , pyobject_enable_deferred_refcount , METH_O },
519528 {"pyobject_is_unique_temporary" , pyobject_is_unique_temporary , METH_O },
529+ {"pyobject_is_unique_temporary_new_object" , pyobject_is_unique_temporary_new_object , METH_NOARGS },
520530 {"test_py_try_inc_ref" , test_py_try_inc_ref , METH_NOARGS },
521531 {"test_xincref_doesnt_leak" ,test_xincref_doesnt_leak , METH_NOARGS },
522532 {"test_incref_doesnt_leak" , test_incref_doesnt_leak , METH_NOARGS },
0 commit comments