diff options
Diffstat (limited to 'Objects/unicodeobject.c')
| -rw-r--r-- | Objects/unicodeobject.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index adeec8cca6..80e6cf26f8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3835,13 +3835,10 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) Py_FileSystemDefaultEncodeErrors); #ifdef MS_WINDOWS if (!res && PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) { - PyObject *exc, *val, *tb; - PyErr_Fetch(&exc, &val, &tb); - PyErr_Format(PyExc_RuntimeError, - "filesystem path bytes were not correctly encoded with '%s'. " \ + _PyErr_FormatFromCause(PyExc_RuntimeError, + "filesystem path bytes were not correctly encoded with '%s'. " "Please report this at http://bugs.python.org/issue27781", Py_FileSystemDefaultEncoding); - _PyErr_ChainExceptions(exc, val, tb); } #endif return res; |
