cpython (merge 3.4 -> 3.5): (Merge 3.4) Issue #25182: Fix compilation on Windows
https://hg.python.org/cpython/rev/0eb26a4d5ffa changeset: 98439:0eb26a4d5ffa branch: 3.5 parent: 98436:e8b6c6c433a4 parent: 98438:2652c1798f7d user: Victor Stinner <victor.stinner@gmail.com> date: Wed Sep 30 15:03:31 2015 +0200 summary: (Merge 3.4) Issue #25182: Fix compilation on Windows files: Objects/fileobject.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Objects/fileobject.c b/Objects/fileobject.c --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -376,7 +376,7 @@ PyObject *bytes = NULL; char *str; Py_ssize_t n; - int _errno; + int err; if (self->fd < 0) { /* fd might be invalid on Windows @@ -403,10 +403,13 @@ } n = _Py_write(self->fd, str, n); - _errno = errno; + /* save errno, it can be modified indirectly by Py_XDECREF() */ + err = errno; + Py_XDECREF(bytes); + if (n == -1) { - if (_errno == EAGAIN) { + if (err == EAGAIN) { PyErr_Clear(); Py_RETURN_NONE; } -- Repository URL: https://hg.python.org/cpython
participants (1)
-
victor.stinner