Commit 23d54261 authored by Stefan Behnel's avatar Stefan Behnel

implement 'raise ... from None' in Py3.3

--HG--
extra : rebase_source : 9ad9c4ea052a3eae0888f02a07ba4c40d62ddddf
parent 862249fd
......@@ -186,9 +186,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
goto bad;
}
if (cause && cause != Py_None) {
if (cause) {
PyObject *fixed_cause;
if (PyExceptionClass_Check(cause)) {
if (cause == Py_None) {
/* raise ... from None */
Py_DECREF(cause);
fixed_cause = NULL;
} else if (PyExceptionClass_Check(cause)) {
fixed_cause = PyObject_CallObject(cause, NULL);
if (fixed_cause == NULL)
goto bad;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment