mirror of
https://github.com/python/cpython.git
synced 2025-10-22 14:42:22 +00:00
ceval.c: catch recursion error on _PyUnicode_AsString(co->co_filename)
This commit is contained in:
parent
8060399654
commit
a00064576a
1 changed files with 4 additions and 0 deletions
|
@ -1232,6 +1232,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
PyObject *error_type, *error_value, *error_traceback;
|
PyObject *error_type, *error_value, *error_traceback;
|
||||||
PyErr_Fetch(&error_type, &error_value, &error_traceback);
|
PyErr_Fetch(&error_type, &error_value, &error_traceback);
|
||||||
filename = _PyUnicode_AsString(co->co_filename);
|
filename = _PyUnicode_AsString(co->co_filename);
|
||||||
|
if (filename == NULL && tstate->overflowed) {
|
||||||
|
/* maximum recursion depth exceeded */
|
||||||
|
goto exit_eval_frame;
|
||||||
|
}
|
||||||
PyErr_Restore(error_type, error_value, error_traceback);
|
PyErr_Restore(error_type, error_value, error_traceback);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue