mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
merge heads
This commit is contained in:
commit
4e07a8c9aa
3 changed files with 7 additions and 4 deletions
|
|
@ -1016,12 +1016,12 @@ OSError_str(PyOSErrorObject *self)
|
|||
#ifdef MS_WINDOWS
|
||||
/* If available, winerror has the priority over myerrno */
|
||||
if (self->winerror && self->filename)
|
||||
return PyUnicode_FromFormat("[Error %S] %S: %R",
|
||||
return PyUnicode_FromFormat("[WinError %S] %S: %R",
|
||||
self->winerror ? self->winerror: Py_None,
|
||||
self->strerror ? self->strerror: Py_None,
|
||||
self->filename);
|
||||
if (self->winerror && self->strerror)
|
||||
return PyUnicode_FromFormat("[Error %S] %S",
|
||||
return PyUnicode_FromFormat("[WinError %S] %S",
|
||||
self->winerror ? self->winerror: Py_None,
|
||||
self->strerror ? self->strerror: Py_None);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue