Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 65250:bf5cfe9a0bb5
ceval.c: catch recursion error on _PyUnicode_AsString(co->co_filename)
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Wed, 13 Oct 2010 10:48:55 +0000 |
| parents | 4cd0edf0b356 |
| children | e8969fb822fc |
line wrap: on
line diff
--- a/Python/ceval.c Wed Oct 13 10:45:16 2010 +0000 +++ b/Python/ceval.c Wed Oct 13 10:48:55 2010 +0000 @@ -1232,6 +1232,10 @@ PyObject *error_type, *error_value, *error_traceback; PyErr_Fetch(&error_type, &error_value, &error_traceback); 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); } #endif
