MCPcopy Create free account
hub / github.com/pyinvoke/invoke / should_use_pty

Method should_use_pty

invoke/runners.py:1256–1267  ·  view source on GitHub ↗
(self, pty: bool = False, fallback: bool = True)

Source from the content-addressed store, hash-verified

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

Calls 1

has_filenoFunction · 0.85

Tested by

no test coverage detected