From: Dag Sverre Seljebotn Date: Sat, 21 Feb 2009 14:43:17 +0000 (+0100) Subject: refnanny: Do Python operations exception-safely in refnanny.pyx X-Git-Tag: 0.11.rc~69 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fd14ceea624450fe4d66099f59e45a9a60307fe7;p=cython.git refnanny: Do Python operations exception-safely in refnanny.pyx --- diff --git a/Cython/Runtime/refnanny.pyx b/Cython/Runtime/refnanny.pyx index b3b3991c..2f698e40 100644 --- a/Cython/Runtime/refnanny.pyx +++ b/Cython/Runtime/refnanny.pyx @@ -124,6 +124,9 @@ cdef void FinishContext(PyObject** ctx): try: errors = (ctx[0]).end() pos = (ctx[0]).filename, (ctx[0]).name + if errors: + print u"%s: %s()" % pos + print errors # raise Error(errors) PyErr_Restore(type, value, tb) except: Py_XDECREF(type) @@ -132,9 +135,6 @@ cdef void FinishContext(PyObject** ctx): finally: Py_XDECREF(ctx[0]) ctx[0] = NULL - if errors: - print u"%s: %s()" % pos - print errors # raise Error(errors) cdef extern from "Python.h": object PyCObject_FromVoidPtr(void*, void (*)(void*))