diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-05 12:00:56 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-05 12:00:56 (GMT) |
commit | 2cfb6f3aa086b1f500516372f7179f10c123a777 (patch) | |
tree | 6d260553316080e266be51cdb6682772f408b8c3 /Lib/subprocess.py | |
parent | c655a726dba5799e3c221b6c95fee72516d3d7cf (diff) | |
download | cpython-2cfb6f3aa086b1f500516372f7179f10c123a777.zip cpython-2cfb6f3aa086b1f500516372f7179f10c123a777.tar.gz cpython-2cfb6f3aa086b1f500516372f7179f10c123a777.tar.bz2 |
Issue #12493: subprocess: communicate() handles EINTR
subprocess.Popen.communicate() now also handles EINTR errors if the process has
only one pipe.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 06285e9..0523219 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -450,7 +450,7 @@ def _eintr_retry_call(func, *args): while True: try: return func(*args) - except OSError as e: + except (OSError, IOError) as e: if e.errno == errno.EINTR: continue raise @@ -804,10 +804,10 @@ class Popen(object): raise self.stdin.close() elif self.stdout: - stdout = self.stdout.read() + stdout = _eintr_retry_call(self.stdout.read) self.stdout.close() elif self.stderr: - stderr = self.stderr.read() + stderr = _eintr_retry_call(self.stderr.read) self.stderr.close() self.wait() return (stdout, stderr) |