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 @@ -1117,7 +1117,7 @@ frame_back_get_impl(PyFrameObject *self)
11171117/*[clinic end generated code: output=3a84c22a55a63c79 input=9e528570d0e1f44a]*/
11181118{
11191119 PyObject * res = (PyObject * )PyFrame_GetBack (self );
1120- if (res == NULL ) {
1120+ if (res == NULL && ! PyErr_Occurred () ) {
11211121 Py_RETURN_NONE ;
11221122 }
11231123 return res ;
@@ -2405,6 +2405,9 @@ PyFrame_GetBack(PyFrameObject *frame)
24052405 prev = _PyFrame_GetFirstComplete (prev );
24062406 if (prev ) {
24072407 back = _PyFrame_GetFrameObject (prev );
2408+ if (back == NULL ) {
2409+ return NULL ;
2410+ }
24082411 }
24092412 }
24102413 return (PyFrameObject * )Py_XNewRef (back );
You can’t perform that action at this time.
0 commit comments