summaryrefslogtreecommitdiff
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-07-05 14:08:01 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-07-05 14:08:01 +0200
commite790131dc6f2e4c125f29c882e64f3c88a4210d1 (patch)
tree7440e0e559e78000a3ce242aabaab4209ebd86be /Lib/subprocess.py
parent4c41f84033ed257b3ef6586acd12ff87d00fa323 (diff)
downloadcpython-git-e790131dc6f2e4c125f29c882e64f3c88a4210d1.tar.gz
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 bdf85fc108..ce08f83939 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -476,7 +476,7 @@ def _eintr_retry_call(func, *args):
while True:
try:
return func(*args)
- except OSError, e:
+ except (OSError, IOError) as e:
if e.errno == errno.EINTR:
continue
raise
@@ -743,10 +743,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)