From fd14ceea624450fe4d66099f59e45a9a60307fe7 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Sat, 21 Feb 2009 15:43:17 +0100 Subject: [PATCH] refnanny: Do Python operations exception-safely in refnanny.pyx --- Cython/Runtime/refnanny.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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*)) -- 2.26.2