summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-07-05 12:04:39 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-07-05 12:04:39 (GMT)
commit5b1261d750793539cf4508a1e76c2f6d20900ac7 (patch)
tree572bba5ca861d7a3fac3d0ad25570c96aa4f764d /Lib/subprocess.py
parentd9fc85db7f644c36d8709af49c97bed62451e59a (diff)
parent2cfb6f3aa086b1f500516372f7179f10c123a777 (diff)
downloadcpython-5b1261d750793539cf4508a1e76c2f6d20900ac7.zip
cpython-5b1261d750793539cf4508a1e76c2f6d20900ac7.tar.gz
cpython-5b1261d750793539cf4508a1e76c2f6d20900ac7.tar.bz2
(merge 3.2) 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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index cfd4c85..83e6c40 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -446,7 +446,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
@@ -820,10 +820,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()
else: