Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r2274:2106b4532288 Date: 2015-09-25 21:00 +0200 http://bitbucket.org/cffi/cffi/changeset/2106b4532288/
Log: Probably need to save/restore the current exception here diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -1661,6 +1661,11 @@ cdata_dealloc((CDataObject *)cd); if (destructor != NULL) { + PyObject *error_type, *error_value, *error_traceback; + + /* Save the current exception */ + PyErr_Fetch(&error_type, &error_value, &error_traceback); + result = PyObject_CallFunctionObjArgs(destructor, origobj, NULL); if (result != NULL) { Py_DECREF(result); @@ -1670,6 +1675,9 @@ origobj, NULL); } Py_DECREF(destructor); + + /* Restore the saved exception */ + PyErr_Restore(error_type, error_value, error_traceback); } Py_DECREF(origobj); } _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit