| 146 | self._transport.kill() |
| 147 | |
| 148 | async def _feed_stdin(self, input): |
| 149 | debug = self._loop.get_debug() |
| 150 | try: |
| 151 | if input is not None: |
| 152 | self.stdin.write(input) |
| 153 | if debug: |
| 154 | logger.debug( |
| 155 | '%r communicate: feed stdin (%s bytes)', self, len(input)) |
| 156 | |
| 157 | await self.stdin.drain() |
| 158 | except (BrokenPipeError, ConnectionResetError) as exc: |
| 159 | # communicate() ignores BrokenPipeError and ConnectionResetError. |
| 160 | # write() and drain() can raise these exceptions. |
| 161 | if debug: |
| 162 | logger.debug('%r communicate: stdin got %r', self, exc) |
| 163 | |
| 164 | if debug: |
| 165 | logger.debug('%r communicate: close stdin', self) |
| 166 | self.stdin.close() |
| 167 | |
| 168 | async def _noop(self): |
| 169 | return None |