fix running test_capi with -R ::
Also, fix a refleak in the test that was preventing running. :)
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index d187c5b..19bb1a6 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -226,6 +226,13 @@
long hash;
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);
if (obj == NULL) {
PyErr_Clear();
@@ -269,6 +276,8 @@
return NULL;
}
+ Py_DECREF(obj);
+
Py_RETURN_NONE;
}