do not try pexpect on windows; fix time.clock error on windows

This commit is contained in:
Paul Gauthier 2024-08-28 22:26:48 -07:00
parent bcb3fa1b47
commit ce397b71e8
4 changed files with 5 additions and 23 deletions

View file

@ -3,6 +3,8 @@ import subprocess
import sys
from io import BytesIO
import pexpect
def run_cmd(command):
import sys
@ -10,9 +12,7 @@ def run_cmd(command):
if not sys.stdin.isatty():
return run_cmd_subprocess(command)
try:
import pexpect # noqa: F401
except ImportError:
if hasattr(pexpect, "spawn"):
return run_cmd_subprocess(command)
return run_cmd_pexpect(command)