summaryrefslogtreecommitdiff
path: root/Lib/asyncio/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-17 13:12:20 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-07-17 13:12:20 +0200
commitedfdf5479057c3ba223234c4fc0165a3abaec44d (patch)
tree95227bc153f79139c7ba41dc0d316806737d57ba /Lib/asyncio/subprocess.py
parent0d35741b167b6c7fdd201944c0e57379b1f246fd (diff)
parentd55b54d5c0e6f469145f394d18e39156baa2ca79 (diff)
downloadcpython-git-edfdf5479057c3ba223234c4fc0165a3abaec44d.tar.gz
(Merge 3.4) asyncio, tulip issue 190: Process.communicate() now ignores
ConnectionResetError too
Diffstat (limited to 'Lib/asyncio/subprocess.py')
-rw-r--r--Lib/asyncio/subprocess.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py
index 23d6b4da92..e4c14995a7 100644
--- a/Lib/asyncio/subprocess.py
+++ b/Lib/asyncio/subprocess.py
@@ -139,17 +139,19 @@ class Process:
@coroutine
def _feed_stdin(self, input):
+ debug = self._loop.get_debug()
self.stdin.write(input)
- if self._loop.get_debug():
+ if debug:
logger.debug('%r communicate: feed stdin (%s bytes)',
self, len(input))
try:
yield from self.stdin.drain()
- except BrokenPipeError:
- # ignore BrokenPipeError
- pass
+ except (BrokenPipeError, ConnectionResetError) as exc:
+ # communicate() ignores BrokenPipeError and ConnectionResetError
+ if debug:
+ logger.debug('%r communicate: stdin got %r', self, exc)
- if self._loop.get_debug():
+ if debug:
logger.debug('%r communicate: close stdin', self)
self.stdin.close()