refnanny fix...
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Tue, 27 Jan 2009 20:54:33 +0000 (21:54 +0100)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Tue, 27 Jan 2009 20:54:33 +0000 (21:54 +0100)
Cython/Runtime/build.sh
Cython/Runtime/refnanny.pyx

index 93a53099eeb4a1d7ab783d367823852ff97ab235..952199a7faf2e2146b3ed00b8ae89a889924b368 100755 (executable)
@@ -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
index 7a045b33e8731c8f6a9d0149dca2d33e6ab7448d..bfa7dc4dbeb03b0a63b33c670d0cb383359625ba 100644 (file)
@@ -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(<object>type); Py_DECREF(<object>value); Py_DECREF(<object>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(<object>type); Py_XDECREF(<object>value); Py_XDECREF(<object>tb)
+##         print "cleared!"
+##         print (exc.PyErr_Occurred() == NULL)
     obj = <object>ctx
     try:
         obj.end()