This commit is contained in:
parent
72d28500b3
commit
8933521b3d
|
@ -3850,20 +3850,16 @@ call_exc_trace(Py_tracefunc func, PyObject *self, PyFrameObject *f)
|
||||||
{
|
{
|
||||||
PyObject *type, *value, *traceback, *orig_traceback, *arg;
|
PyObject *type, *value, *traceback, *orig_traceback, *arg;
|
||||||
int err;
|
int err;
|
||||||
PyErr_Fetch(&type, &value, &traceback);
|
PyErr_Fetch(&type, &value, &orig_traceback);
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
value = Py_None;
|
value = Py_None;
|
||||||
Py_INCREF(value);
|
Py_INCREF(value);
|
||||||
}
|
}
|
||||||
PyErr_NormalizeException(&type, &value, &traceback);
|
PyErr_NormalizeException(&type, &value, &orig_traceback);
|
||||||
orig_traceback = traceback;
|
traceback = (orig_traceback != NULL) ? orig_traceback : Py_None;
|
||||||
if (traceback == NULL) {
|
|
||||||
Py_INCREF(Py_None);
|
|
||||||
traceback = Py_None;
|
|
||||||
}
|
|
||||||
arg = PyTuple_Pack(3, type, value, traceback);
|
arg = PyTuple_Pack(3, type, value, traceback);
|
||||||
if (arg == NULL) {
|
if (arg == NULL) {
|
||||||
PyErr_Restore(type, value, traceback);
|
PyErr_Restore(type, value, orig_traceback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
err = call_trace(func, self, f, PyTrace_EXCEPTION, arg);
|
err = call_trace(func, self, f, PyTrace_EXCEPTION, arg);
|
||||||
|
|
Loading…
Reference in New Issue