mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
fix running test_capi with -R ::
Also, fix a refleak in the test that was preventing running. :)
This commit is contained in:
parent
a57773e483
commit
a98c8e1d2d
1 changed files with 9 additions and 0 deletions
|
@ -226,6 +226,13 @@ test_lazy_hash_inheritance(PyObject* self)
|
||||||
long hash;
|
long hash;
|
||||||
|
|
||||||
type = &_HashInheritanceTester_Type;
|
type = &_HashInheritanceTester_Type;
|
||||||
|
|
||||||
|
if (type->tp_dict != NULL)
|
||||||
|
/* The type has already been initialized. This probably means -R
|
||||||
|
is being used. */
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
|
||||||
|
|
||||||
obj = PyObject_New(PyObject, type);
|
obj = PyObject_New(PyObject, type);
|
||||||
if (obj == NULL) {
|
if (obj == NULL) {
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
|
@ -269,6 +276,8 @@ test_lazy_hash_inheritance(PyObject* self)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Py_DECREF(obj);
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue