File tree Expand file tree Collapse file tree
Misc/NEWS.d/next/Core_and_Builtins Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Fix OOM error handling in :c:func: `PyFrame_GetBack ` to propagate exceptions instead of masking them as None.
Original file line number Diff line number Diff line change @@ -1114,7 +1114,7 @@ frame_back_get_impl(PyFrameObject *self)
11141114/*[clinic end generated code: output=3a84c22a55a63c79 input=9e528570d0e1f44a]*/
11151115{
11161116 PyObject * res = (PyObject * )PyFrame_GetBack (self );
1117- if (res == NULL ) {
1117+ if (res == NULL && ! PyErr_Occurred () ) {
11181118 Py_RETURN_NONE ;
11191119 }
11201120 return res ;
@@ -2402,6 +2402,9 @@ PyFrame_GetBack(PyFrameObject *frame)
24022402 prev = _PyFrame_GetFirstComplete (prev );
24032403 if (prev ) {
24042404 back = _PyFrame_GetFrameObject (prev );
2405+ if (back == NULL ) {
2406+ return NULL ;
2407+ }
24052408 }
24062409 }
24072410 return (PyFrameObject * )Py_XNewRef (back );
You can’t perform that action at this time.
0 commit comments