fix pexpect logic

This commit is contained in:
Paul Gauthier 2024-08-29 05:55:24 -07:00
parent 9b4ee190ba
commit 6e2a423686

View file

@ -9,13 +9,10 @@ import pexpect
def run_cmd(command):
import sys
if not sys.stdin.isatty():
return run_cmd_subprocess(command)
if sys.stdin.isatty() and hasattr(pexpect, "spawn"):
return run_cmd_pexpect(command)
if hasattr(pexpect, "spawn"):
return run_cmd_subprocess(command)
return run_cmd_pexpect(command)
return run_cmd_subprocess(command)
def run_cmd_subprocess(command):