[Python-checkins] r72358 - in python/branches/py3k: Modules/_testcapimodule.c
benjamin.peterson
python-checkins at python.org
Tue May 5 23:11:54 CEST 2009
Author: benjamin.peterson
Date: Tue May 5 23:11:54 2009
New Revision: 72358
Log:
Merged revisions 72357 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72357 | benjamin.peterson | 2009年05月05日 16:09:21 -0500 (2009年5月05日) | 4 lines
fix running test_capi with -R ::
Also, fix a refleak in the test that was preventing running. :)
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Modules/_testcapimodule.c
Modified: python/branches/py3k/Modules/_testcapimodule.c
==============================================================================
--- python/branches/py3k/Modules/_testcapimodule.c (original)
+++ python/branches/py3k/Modules/_testcapimodule.c Tue May 5 23:11:54 2009
@@ -227,6 +227,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();
@@ -270,6 +277,8 @@
return NULL;
}
+ Py_DECREF(obj);
+
Py_RETURN_NONE;
}
More information about the Python-checkins
mailing list