mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
Merge pull request #1423 from fry69/win-lint-fix
fix: handle OSError when executing lint command
This commit is contained in:
commit
ab35e473f3
1 changed files with 12 additions and 8 deletions
|
@ -46,14 +46,18 @@ class Linter:
|
||||||
cmd += " " + rel_fname
|
cmd += " " + rel_fname
|
||||||
cmd = cmd.split()
|
cmd = cmd.split()
|
||||||
|
|
||||||
process = subprocess.Popen(
|
try:
|
||||||
cmd,
|
process = subprocess.Popen(
|
||||||
cwd=self.root,
|
cmd,
|
||||||
stdout=subprocess.PIPE,
|
cwd=self.root,
|
||||||
stderr=subprocess.STDOUT,
|
stdout=subprocess.PIPE,
|
||||||
encoding=self.encoding,
|
stderr=subprocess.STDOUT,
|
||||||
errors="replace",
|
encoding=self.encoding,
|
||||||
)
|
errors="replace",
|
||||||
|
)
|
||||||
|
except OSError as err:
|
||||||
|
print(f"Unable to execute lint command: {err}")
|
||||||
|
return
|
||||||
stdout, _ = process.communicate()
|
stdout, _ = process.communicate()
|
||||||
errors = stdout
|
errors = stdout
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue