mirror of https://github.com/python/cpython
Trivial fix to the pep277 checkin: ensure that exceptions always have a filename attribute (previously did only when string filenames were passed, but not when unicode)
This commit is contained in:
parent
c2e85bd4e2
commit
d389036069
|
@ -560,7 +560,7 @@ posix_1str(PyObject *args, char *format, int (*func)(const char*),
|
|||
res = (*wfunc)(PyUnicode_AS_UNICODE(po));
|
||||
Py_END_ALLOW_THREADS
|
||||
if (res < 0)
|
||||
return posix_error();
|
||||
return posix_error_with_unicode_filename(PyUnicode_AS_UNICODE(po));
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue