Ticket #362 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

PyErr_Restore declaration

Reported by: dalcinl Owned by: dalcinl
Priority: major Milestone: 0.11.3
Component: Packaging Keywords:
Cc:

Description

On Sep 9, 2009, at 12:24 PM, Lisandro Dalcin wrote:

I would like to change this declaration (in Cython/Includes/ 
python_exc.pxd)

    void PyErr_Restore(object type, object value, object traceback)

for this

    void PyErr_Restore(PyObject *type, PyObject *value, PyObject  
*traceback)

1) That call is usually used after PyErr_Fetch(), which has  
PyObject** args...
2) This call steals references, so IMO it is dangerous to use  
'object' arguments
3) If should be valid to call  PyErr_Restore(NULL,NULL,NULL)
(documented to clear the error indicator)

with this change, these lines (in Cython/Runtime/refnanny.pyx)

    PyErr_Restore(<object>type, <object>value, <object>tb)

will become

    PyErr_Restore(type, value, tb)

Any objections? Am I missing something?

Change History

Changed 4 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.