diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-05 21:11:54 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-05 21:11:54 (GMT) |
commit | f172637bc7198e626fca2937e200170fbac64413 (patch) | |
tree | 509347fd317613b52ea43372eab5ba4fb5d23acf /Modules | |
parent | 00cfc379d66c056ed5ac5a9df5b75c86f3fc7fbe (diff) | |
download | cpython-f172637bc7198e626fca2937e200170fbac64413.zip cpython-f172637bc7198e626fca2937e200170fbac64413.tar.gz cpython-f172637bc7198e626fca2937e200170fbac64413.tar.bz2 |
Merged revisions 72357 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72357 | benjamin.peterson | 2009-05-05 16:09:21 -0500 (Tue, 05 May 2009) | 4 lines
fix running test_capi with -R ::
Also, fix a refleak in the test that was preventing running. :)
........
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_testcapimodule.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 1cbb825..3f7190c 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -227,6 +227,13 @@ test_lazy_hash_inheritance(PyObject* self) 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 @@ test_lazy_hash_inheritance(PyObject* self) return NULL; } + Py_DECREF(obj); + Py_RETURN_NONE; } |