(self, pty: bool = False, fallback: bool = True)
| 1254 | self.status = 0 |
| 1255 | |
| 1256 | def should_use_pty(self, pty: bool = False, fallback: bool = True) -> bool: |
| 1257 | use_pty = False |
| 1258 | if pty: |
| 1259 | use_pty = True |
| 1260 | # TODO: pass in & test in_stream, not sys.stdin |
| 1261 | if not has_fileno(sys.stdin) and fallback: |
| 1262 | if not self.warned_about_pty_fallback: |
| 1263 | err = "WARNING: stdin has no fileno; falling back to non-pty execution!\n" # noqa |
| 1264 | sys.stderr.write(err) |
| 1265 | self.warned_about_pty_fallback = True |
| 1266 | use_pty = False |
| 1267 | return use_pty |
| 1268 | |
| 1269 | def read_proc_stdout(self, num_bytes: int) -> Optional[bytes]: |
| 1270 | # Obtain useful read-some-bytes function |
no test coverage detected