From d2b2680dd1d26a5a4700dc19da24047c376ddc74 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Wed, 9 Sep 2009 17:30:09 -0300 Subject: [PATCH] use PyObject* type for arguments to PyErr_Restore() in Cython/Includes/python_exc.pxd --- Cython/Includes/python_exc.pxd | 2 +- Cython/Runtime/refnanny.pyx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cython/Includes/python_exc.pxd b/Cython/Includes/python_exc.pxd index 24788c72..8a6d29cf 100644 --- a/Cython/Includes/python_exc.pxd +++ b/Cython/Includes/python_exc.pxd @@ -87,7 +87,7 @@ cdef extern from "Python.h": # needs to handle exceptions or by code that needs to save and # restore the error indicator temporarily. - void PyErr_Restore(object type, object value, object traceback) + void PyErr_Restore(PyObject* type, PyObject* value, PyObject* traceback) # Set the error indicator from the three objects. If the error # indicator is already set, it is cleared first. If the objects # are NULL, the error indicator is cleared. Do not pass a NULL diff --git a/Cython/Runtime/refnanny.pyx b/Cython/Runtime/refnanny.pyx index 64cac867..5f278c99 100644 --- a/Cython/Runtime/refnanny.pyx +++ b/Cython/Runtime/refnanny.pyx @@ -59,7 +59,7 @@ class Context(object): else: return None -cpdef report_unraisable(e): +cdef void report_unraisable(object e): try: print "refnanny raised an exception: %s" % e except: @@ -84,7 +84,7 @@ cdef PyObject* NewContext(char* funcname, int lineno, char* filename) except NUL result = ctx except Exception, e: report_unraisable(e) - PyErr_Restore(type, value, tb) + PyErr_Restore(type, value, tb) return result cdef void GOTREF(PyObject* ctx, PyObject* p_obj, int lineno): @@ -98,7 +98,7 @@ cdef void GOTREF(PyObject* ctx, PyObject* p_obj, int lineno): (ctx).regref(p_obj, lineno, False) except Exception, e: report_unraisable(e) - PyErr_Restore(type, value, tb) + PyErr_Restore(type, value, tb) cdef int GIVEREF_and_report(PyObject* ctx, PyObject* p_obj, int lineno): if ctx == NULL: return 1 @@ -112,7 +112,7 @@ cdef int GIVEREF_and_report(PyObject* ctx, PyObject* p_obj, int lineno): decref_ok = (ctx).delref(p_obj, lineno, False) except Exception, e: report_unraisable(e) - PyErr_Restore(type, value, tb) + PyErr_Restore(type, value, tb) return decref_ok cdef void GIVEREF(PyObject* ctx, PyObject* p_obj, int lineno): @@ -141,7 +141,7 @@ cdef void FinishContext(PyObject** ctx): report_unraisable(e) Py_DECREF(ctx[0]) ctx[0] = NULL - PyErr_Restore(type, value, tb) + PyErr_Restore(type, value, tb) cdef extern from "Python.h": object PyCObject_FromVoidPtr(void*, void (*)(void*)) -- 2.26.2