Commit eda7bca9 authored by Stefan Behnel's avatar Stefan Behnel

allow "args" tuple argument to be NULL in __Pyx__Coroutine_Throw() and only...

allow "args" tuple argument to be NULL in __Pyx__Coroutine_Throw() and only create a tuple if necessary
parent c857fc3e
......@@ -856,7 +856,12 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject
gen->is_running = 0;
goto throw_here;
}
ret = PyObject_CallObject(meth, args);
if (likely(args)) {
ret = PyObject_CallObject(meth, args);
} else {
// "tb" or even "val" might be NULL, but that also correctly terminates the argument list
ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
}
Py_DECREF(meth);
}
gen->is_running = 0;
......
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