Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix OOM error handling in :c:func:`PyFrame_GetBack` to propagate exceptions instead of masking them as None.
5 changes: 4 additions & 1 deletion Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ frame_back_get_impl(PyFrameObject *self)
/*[clinic end generated code: output=3a84c22a55a63c79 input=9e528570d0e1f44a]*/
{
PyObject *res = (PyObject *)PyFrame_GetBack(self);
if (res == NULL) {
if (res == NULL && !PyErr_Occurred()) {
Py_RETURN_NONE;
}
return res;
Expand Down Expand Up @@ -2405,6 +2405,9 @@ PyFrame_GetBack(PyFrameObject *frame)
prev = _PyFrame_GetFirstComplete(prev);
if (prev) {
back = _PyFrame_GetFrameObject(prev);
if (back == NULL) {
return NULL;
}
}
}
return (PyFrameObject*)Py_XNewRef(back);
Expand Down
Loading