summaryrefslogtreecommitdiffstats
path: root/Modules/_io/textio.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2013-02-01 21:03:39 (GMT)
committerGregory P. Smith <greg@krypto.org>2013-02-01 21:03:39 (GMT)
commitb9817b01edfe6fa369c4c291a5de00732b8abc7c (patch)
tree6c6c6482442bfc0718bba8deb8c5e08f5d7034e9 /Modules/_io/textio.c
parentb47acbf46abd425f69dcc03e9b4f0c7f7c321ac2 (diff)
downloadcpython-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/textio.c')
-rw-r--r--Modules/_io/textio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 2fbb8f3..7d48388 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1249,8 +1249,11 @@ _textiowrapper_writeflush(textio *self)
Py_DECREF(pending);
if (b == NULL)
return -1;
- ret = PyObject_CallMethodObjArgs(self->buffer,
- _PyIO_str_write, b, NULL);
+ ret = NULL;
+ do {
+ ret = PyObject_CallMethodObjArgs(self->buffer,
+ _PyIO_str_write, b, NULL);
+ } while (ret == NULL && _PyIO_trap_eintr());
Py_DECREF(b);
if (ret == NULL)
return -1;