mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #9425: save/restore exception on filename encoding
_PyUnicode_AsString() raises an exception on unencodable filename.
This commit is contained in:
parent
028dd97dfb
commit
4a3733d160
1 changed files with 6 additions and 1 deletions
|
@ -1213,7 +1213,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
lltrace = PyDict_GetItemString(f->f_globals, "__lltrace__") != NULL;
|
lltrace = PyDict_GetItemString(f->f_globals, "__lltrace__") != NULL;
|
||||||
#endif
|
#endif
|
||||||
#if defined(Py_DEBUG) || defined(LLTRACE)
|
#if defined(Py_DEBUG) || defined(LLTRACE)
|
||||||
filename = _PyUnicode_AsString(co->co_filename);
|
{
|
||||||
|
PyObject *error_type, *error_value, *error_traceback;
|
||||||
|
PyErr_Fetch(&error_type, &error_value, &error_traceback);
|
||||||
|
filename = _PyUnicode_AsString(co->co_filename);
|
||||||
|
PyErr_Restore(error_type, error_value, error_traceback);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
why = WHY_NOT;
|
why = WHY_NOT;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue