From 6e2a42368696eb76c8e12f8b4c629d68f4f423c9 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 29 Aug 2024 05:55:24 -0700 Subject: [PATCH] fix pexpect logic --- aider/run_cmd.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/aider/run_cmd.py b/aider/run_cmd.py index 003727ea1..910b67005 100644 --- a/aider/run_cmd.py +++ b/aider/run_cmd.py @@ -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):