cython-devel

changeset 2111:8157444859b4

use PyObject* type for arguments to PyErr_Restore() in Cython/Includes/python_exc.pxd
author Lisandro Dalcin <dalcinl@gmail.com>
date Wed Sep 09 17:30:09 2009 -0300 (4 years ago)
parents 5f8653965c34
children c951607190c2
files Cython/Includes/python_exc.pxd Cython/Runtime/refnanny.pyx
line diff
1.1 --- a/Cython/Includes/python_exc.pxd Wed Sep 09 15:52:08 2009 -0300 1.2 +++ b/Cython/Includes/python_exc.pxd Wed Sep 09 17:30:09 2009 -0300 1.3 @@ -87,7 +87,7 @@ 1.4 # needs to handle exceptions or by code that needs to save and 1.5 # restore the error indicator temporarily. 1.6 1.7 - void PyErr_Restore(object type, object value, object traceback) 1.8 + void PyErr_Restore(PyObject* type, PyObject* value, PyObject* traceback) 1.9 # Set the error indicator from the three objects. If the error 1.10 # indicator is already set, it is cleared first. If the objects 1.11 # are NULL, the error indicator is cleared. Do not pass a NULL
2.1 --- a/Cython/Runtime/refnanny.pyx Wed Sep 09 15:52:08 2009 -0300 2.2 +++ b/Cython/Runtime/refnanny.pyx Wed Sep 09 17:30:09 2009 -0300 2.3 @@ -59,7 +59,7 @@ 2.4 else: 2.5 return None 2.6 2.7 -cpdef report_unraisable(e): 2.8 +cdef void report_unraisable(object e): 2.9 try: 2.10 print "refnanny raised an exception: %s" % e 2.11 except: 2.12 @@ -84,7 +84,7 @@ 2.13 result = <PyObject*>ctx 2.14 except Exception, e: 2.15 report_unraisable(e) 2.16 - PyErr_Restore(<object>type, <object>value, <object>tb) 2.17 + PyErr_Restore(type, value, tb) 2.18 return result 2.19 2.20 cdef void GOTREF(PyObject* ctx, PyObject* p_obj, int lineno): 2.21 @@ -98,7 +98,7 @@ 2.22 (<object>ctx).regref(<object>p_obj, lineno, False) 2.23 except Exception, e: 2.24 report_unraisable(e) 2.25 - PyErr_Restore(<object>type, <object>value, <object>tb) 2.26 + PyErr_Restore(type, value, tb) 2.27 2.28 cdef int GIVEREF_and_report(PyObject* ctx, PyObject* p_obj, int lineno): 2.29 if ctx == NULL: return 1 2.30 @@ -112,7 +112,7 @@ 2.31 decref_ok = (<object>ctx).delref(<object>p_obj, lineno, False) 2.32 except Exception, e: 2.33 report_unraisable(e) 2.34 - PyErr_Restore(<object>type, <object>value, <object>tb) 2.35 + PyErr_Restore(type, value, tb) 2.36 return decref_ok 2.37 2.38 cdef void GIVEREF(PyObject* ctx, PyObject* p_obj, int lineno): 2.39 @@ -141,7 +141,7 @@ 2.40 report_unraisable(e) 2.41 Py_DECREF(<object>ctx[0]) 2.42 ctx[0] = NULL 2.43 - PyErr_Restore(<object>type, <object>value, <object>tb) 2.44 + PyErr_Restore(type, value, tb) 2.45 2.46 cdef extern from "Python.h": 2.47 object PyCObject_FromVoidPtr(void*, void (*)(void*))