fix: handle ValueError exception in run_cmd_pexpect function

This commit is contained in:
Paul Gauthier 2024-09-10 12:06:45 -07:00 committed by Paul Gauthier (aider)
parent c152c96fcc
commit 484fdd7aa3

View file

@ -126,6 +126,6 @@ def run_cmd_pexpect(command, verbose=False):
child.close() child.close()
return child.exitstatus, output.getvalue().decode("utf-8", errors="replace") return child.exitstatus, output.getvalue().decode("utf-8", errors="replace")
except (pexpect.ExceptionPexpect, TypeError) as e: except (pexpect.ExceptionPexpect, TypeError, ValueError) as e:
error_msg = f"Error running command {command}: {e}" error_msg = f"Error running command {command}: {e}"
return 1, error_msg return 1, error_msg