Skip to content

Commit 08cb7a6

Browse files
fix assert(!PyErr_Occurred()) in _PyType_LookupStackRefAndVersion
Signed-off-by: Prakash Sellathurai <prakashsellathurai@gmail.com>
1 parent aa5b164 commit 08cb7a6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Objects/frameobject.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)