Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use PyErr_GetRaisedException
  • Loading branch information
kumaraditya303 committed May 12, 2023
commit a29d72b0f92d553f1900e21f384659a566bc208d
5 changes: 2 additions & 3 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -9121,8 +9121,7 @@ releasebuffer_call_python(PyObject *self, Py_buffer *buffer)
// We have no way to report additional errors up the stack, because
// this slot returns void, so we simply stash away the active exception
// and restore it after the call to Python returns.
PyObject *type, *value, *traceback;
PyErr_Fetch(&type, &value, &traceback);
PyObject *exc = PyErr_GetRaisedException();

PyObject *mv;
bool is_buffer_wrapper = Py_TYPE(buffer->obj) == &_PyBufferWrapper_Type;
Expand Down Expand Up @@ -9165,7 +9164,7 @@ releasebuffer_call_python(PyObject *self, Py_buffer *buffer)
end:
assert(!PyErr_Occurred());

PyErr_Restore(type, value, traceback);
PyErr_SetRaisedException(exc);
}

/*
Expand Down