summaryrefslogtreecommitdiffstats
path: root/Python/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/frame.c')
-rw-r--r--Python/frame.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/frame.c b/Python/frame.c
index b562709..c2c0be3 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -29,17 +29,14 @@ PyFrameObject *
_PyFrame_MakeAndSetFrameObject(_PyInterpreterFrame *frame)
{
assert(frame->frame_obj == NULL);
- PyObject *error_type, *error_value, *error_traceback;
- PyErr_Fetch(&error_type, &error_value, &error_traceback);
+ PyObject *exc = PyErr_GetRaisedException();
PyFrameObject *f = _PyFrame_New_NoTrack(frame->f_code);
if (f == NULL) {
- Py_XDECREF(error_type);
- Py_XDECREF(error_value);
- Py_XDECREF(error_traceback);
+ Py_XDECREF(exc);
return NULL;
}
- PyErr_Restore(error_type, error_value, error_traceback);
+ PyErr_SetRaisedException(exc);
if (frame->frame_obj) {
// GH-97002: How did we get into this horrible situation? Most likely,
// allocating f triggered a GC collection, which ran some code that