diff options
Diffstat (limited to 'Lib/asyncio/subprocess.py')
-rw-r--r-- | Lib/asyncio/subprocess.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index 23d6b4d..e4c1499 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() |