diff options
author | Gregory P. Smith <greg@krypto.org> | 2013-02-01 21:03:39 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2013-02-01 21:03:39 (GMT) |
commit | b9817b01edfe6fa369c4c291a5de00732b8abc7c (patch) | |
tree | 6c6c6482442bfc0718bba8deb8c5e08f5d7034e9 /Modules/_io/iobase.c | |
parent | b47acbf46abd425f69dcc03e9b4f0c7f7c321ac2 (diff) | |
download | cpython-b9817b01edfe6fa369c4c291a5de00732b8abc7c.zip cpython-b9817b01edfe6fa369c4c291a5de00732b8abc7c.tar.gz cpython-b9817b01edfe6fa369c4c291a5de00732b8abc7c.tar.bz2 |
Additional fix for Issue #12268: The io module file object writelines() methods no longer abort early when one of its write system calls is interrupted (EINTR).
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r-- | Modules/_io/iobase.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index ba86146..8b17ecd 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -674,7 +674,10 @@ iobase_writelines(PyObject *self, PyObject *args) break; /* Stop Iteration */ } - res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); + res = NULL; + do { + res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); + } while (res == NULL && _PyIO_trap_eintr()); Py_DECREF(line); if (res == NULL) { Py_DECREF(iter); |