diff options
author | Collin Winter <collinw@gmail.com> | 2010-02-03 20:29:10 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2010-02-03 20:29:10 (GMT) |
commit | 2905baff05c4d1a96b5cb92398af512f7bb6ddee (patch) | |
tree | 795019ef42e85f05f9e986238d7b7fbc0fb34f74 /Modules | |
parent | 5adf89dbe112cafe9451201c7338911350f03dae (diff) | |
download | cpython-2905baff05c4d1a96b5cb92398af512f7bb6ddee.zip cpython-2905baff05c4d1a96b5cb92398af512f7bb6ddee.tar.gz cpython-2905baff05c4d1a96b5cb92398af512f7bb6ddee.tar.bz2 |
Merged revisions 72357,72367 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72357 | benjamin.peterson | 2009-05-05 14:09:21 -0700 (Tue, 05 May 2009) | 4 lines
fix running test_capi with -R ::
Also, fix a refleak in the test that was preventing running. :)
........
r72367 | benjamin.peterson | 2009-05-05 16:00:48 -0700 (Tue, 05 May 2009) | 1 line
tabify :(
........
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 665d375..238e494 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -226,6 +226,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(); @@ -269,6 +276,8 @@ test_lazy_hash_inheritance(PyObject* self) return NULL; } + Py_DECREF(obj); + Py_RETURN_NONE; } |