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:
Mark Hammond 2002-10-03 07:24:48 +00:00
parent c2e85bd4e2
commit d389036069
1 changed files with 1 additions and 1 deletions

View File

@ -560,7 +560,7 @@ posix_1str(PyObject *args, char *format, int (*func)(const char*),
res = (*wfunc)(PyUnicode_AS_UNICODE(po)); res = (*wfunc)(PyUnicode_AS_UNICODE(po));
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
if (res < 0) if (res < 0)
return posix_error(); return posix_error_with_unicode_filename(PyUnicode_AS_UNICODE(po));
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }