Author: Ronan Lamy <ronan.l...@gmail.com> Branch: cpyext-ext Changeset: r82513:4f809c093ddd Date: 2016-02-25 17:00 +0100 http://bitbucket.org/pypy/pypy/changeset/4f809c093ddd/
Log: Fix refcount bug in test diff --git a/pypy/module/cpyext/test/test_dictobject.py b/pypy/module/cpyext/test/test_dictobject.py --- a/pypy/module/cpyext/test/test_dictobject.py +++ b/pypy/module/cpyext/test/test_dictobject.py @@ -169,9 +169,8 @@ w_proxy, space.wrap('sys')) raises(OperationError, space.call_method, w_proxy, 'clear') assert api.PyDictProxy_Check(w_proxy) - + class AppTestDictObject(AppTestCpythonExtensionBase): - #@py.test.mark.xfail(reason='make_frozendict memoize only works translated') def test_dictproxytype(self): module = self.import_extension('foo', [ ("dict_proxy", "METH_VARARGS", @@ -182,12 +181,11 @@ if (!PyArg_ParseTuple(args, "O", &dict)) return NULL; proxydict = PyDictProxy_New(dict); - Py_DECREF(dict); if (!PyDictProxy_Check(proxydict)) { Py_DECREF(proxydict); PyErr_SetNone(PyExc_ValueError); return NULL; - } + } if (!PyDictProxy_CheckExact(proxydict)) { Py_DECREF(proxydict); PyErr_SetNone(PyExc_ValueError); @@ -195,7 +193,7 @@ } i = PyObject_Size(proxydict); Py_DECREF(proxydict); - return PyLong_FromLong(i); + return PyLong_FromLong(i); """), ]) assert module.dict_proxy({'a': 1, 'b': 2}) == 2 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit