(self, input)
| 1138 | return self._devnull |
| 1139 | |
| 1140 | def _stdin_write(self, input): |
| 1141 | if input: |
| 1142 | try: |
| 1143 | self.stdin.write(input) |
| 1144 | except BrokenPipeError: |
| 1145 | pass # communicate() must ignore broken pipe errors. |
| 1146 | except OSError as exc: |
| 1147 | if exc.errno == errno.EINVAL: |
| 1148 | # bpo-19612, bpo-30418: On Windows, stdin.write() fails |
| 1149 | # with EINVAL if the child process exited or if the child |
| 1150 | # process is still running but closed the pipe. |
| 1151 | pass |
| 1152 | else: |
| 1153 | raise |
| 1154 | |
| 1155 | try: |
| 1156 | self.stdin.close() |
| 1157 | except BrokenPipeError: |
| 1158 | pass # communicate() must ignore broken pipe errors. |
| 1159 | except OSError as exc: |
| 1160 | if exc.errno == errno.EINVAL: |
| 1161 | pass |
| 1162 | else: |
| 1163 | raise |
| 1164 | |
| 1165 | def communicate(self, input=None, timeout=None): |
| 1166 | """Interact with process: Send data to stdin and close it. |
no test coverage detected