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).

This commit is contained in:
Gregory P. Smith 2013-02-01 13:03:39 -08:00
parent b47acbf46a
commit b9817b01ed
3 changed files with 12 additions and 3 deletions

View file

@ -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);