From c299574227b880771667ea212749053654bcd72b Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Tue, 27 Jan 2009 21:54:33 +0100 Subject: [PATCH] refnanny fix... --- Cython/Runtime/build.sh | 2 +- Cython/Runtime/refnanny.pyx | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cython/Runtime/build.sh b/Cython/Runtime/build.sh index 93a53099..952199a7 100755 --- a/Cython/Runtime/build.sh +++ b/Cython/Runtime/build.sh @@ -5,6 +5,6 @@ PYTHONINC=/usr/include/python2.5 python ../../cython.py refnanny.pyx -gcc -shared -pthread -fPIC -fwrapv -O2 -Wall \ +gcc -shared -pthread -fPIC -fwrapv -g -Wall \ -fno-strict-aliasing -I$PYTHONINC \ -o refnanny.so -I. refnanny.c diff --git a/Cython/Runtime/refnanny.pyx b/Cython/Runtime/refnanny.pyx index 7a045b33..bfa7dc4d 100644 --- a/Cython/Runtime/refnanny.pyx +++ b/Cython/Runtime/refnanny.pyx @@ -1,4 +1,4 @@ -from python_ref cimport Py_INCREF, Py_DECREF +from python_ref cimport Py_INCREF, Py_DECREF, Py_XDECREF cimport python_exc as exc @@ -45,7 +45,8 @@ class RefnannyContext(object): msg += "\n Acquired on lines: " + ", ".join(["%d" % x for x in linenos]) self.errors.append("References leaked: %s" % msg) if self.errors: - raise RefnannyException("\n".join(self.errors)) + print self.errors +# raise RefnannyException("\n".join(self.errors)) cdef public void* __Pyx_Refnanny_NewContext(char* funcname, int lineno) except NULL: ctx = RefnannyContext() @@ -71,12 +72,12 @@ cdef public void __Pyx_Refnanny_DECREF(void* ctx, object obj, int lineno): Py_DECREF(obj) cdef public int __Pyx_Refnanny_FinishContext(void* ctx) except -1: - cdef exc.PyObject* type, *value, *tb - if exc.PyErr_Occurred(): - exc.PyErr_Fetch(&type, &value, &tb) - Py_DECREF(type); Py_DECREF(value); Py_DECREF(tb) - print "cleared!" - print (exc.PyErr_Occurred() == NULL) +# cdef exc.PyObject* type, *value, *tb +## if exc.PyErr_Occurred(): +## exc.PyErr_Fetch(&type, &value, &tb) +## Py_XDECREF(type); Py_XDECREF(value); Py_XDECREF(tb) +## print "cleared!" +## print (exc.PyErr_Occurred() == NULL) obj = ctx try: obj.end() -- 2.26.2