diff options
author | Thomas Heller <theller@ctypes.org> | 2006-10-27 18:31:36 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2006-10-27 18:31:36 (GMT) |
commit | df08f0b9a0a3de196336b6b4f158fa2325d08479 (patch) | |
tree | 5a8ec68d0f1bb633c58939c64e51381d991f66f5 /Objects/exceptions.c | |
parent | 9627ce116f36ee3d68adcc2cbb8450693198212b (diff) | |
download | cpython-df08f0b9a0a3de196336b6b4f158fa2325d08479.zip cpython-df08f0b9a0a3de196336b6b4f158fa2325d08479.tar.gz cpython-df08f0b9a0a3de196336b6b4f158fa2325d08479.tar.bz2 |
WindowsError.str should display the windows error code,
not the posix error code; with test.
Fixes #1576174.
Will backport to release25-maint.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r-- | Objects/exceptions.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index c0b813d..0cd819c 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -828,9 +828,9 @@ WindowsError_str(PyWindowsErrorObject *self) return NULL; } - if (self->myerrno) { - Py_INCREF(self->myerrno); - PyTuple_SET_ITEM(tuple, 0, self->myerrno); + if (self->winerror) { + Py_INCREF(self->winerror); + PyTuple_SET_ITEM(tuple, 0, self->winerror); } else { Py_INCREF(Py_None); @@ -852,7 +852,7 @@ WindowsError_str(PyWindowsErrorObject *self) Py_DECREF(fmt); Py_DECREF(tuple); } - else if (self->myerrno && self->strerror) { + else if (self->winerror && self->strerror) { PyObject *fmt; PyObject *tuple; @@ -866,9 +866,9 @@ WindowsError_str(PyWindowsErrorObject *self) return NULL; } - if (self->myerrno) { - Py_INCREF(self->myerrno); - PyTuple_SET_ITEM(tuple, 0, self->myerrno); + if (self->winerror) { + Py_INCREF(self->winerror); + PyTuple_SET_ITEM(tuple, 0, self->winerror); } else { Py_INCREF(Py_None); |