Merge pull request #1423 from fry69/win-lint-fix

fix: handle OSError when executing lint command
This commit is contained in:
paul-gauthier 2024-09-08 08:58:14 -07:00 committed by GitHub
commit ab35e473f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,14 +46,18 @@ class Linter:
cmd += " " + rel_fname
cmd = cmd.split()
process = subprocess.Popen(
cmd,
cwd=self.root,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding=self.encoding,
errors="replace",
)
try:
process = subprocess.Popen(
cmd,
cwd=self.root,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding=self.encoding,
errors="replace",
)
except OSError as err:
print(f"Unable to execute lint command: {err}")
return
stdout, _ = process.communicate()
errors = stdout
if process.returncode == 0: