Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a000645

Browse files
author
Victor Stinner
committed
ceval.c: catch recursion error on _PyUnicode_AsString(co->co_filename)
1 parent 8060399 commit a000645

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Python/ceval.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
12321232
PyObject *error_type, *error_value, *error_traceback;
12331233
PyErr_Fetch(&error_type, &error_value, &error_traceback);
12341234
filename = _PyUnicode_AsString(co->co_filename);
1235+
if (filename == NULL && tstate->overflowed) {
1236+
/* maximum recursion depth exceeded */
1237+
goto exit_eval_frame;
1238+
}
12351239
PyErr_Restore(error_type, error_value, error_traceback);
12361240
}
12371241
#endif

0 commit comments

Comments
 (0)