Skip to content

Commit

Permalink
Bachmann1234#378 Explicitly check for FileNotFound instead
Browse files Browse the repository at this point in the history
  • Loading branch information
d-perl committed Dec 14, 2023
1 parent 0410b2b commit 13ba02b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions diff_cover/command_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ def run_command_for_code(command):
"""
Returns command's exit code.
"""
process = subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
)
process.communicate()
try:
process = subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
process.communicate()
except FileNotFoundError:
return 1
return process.returncode


Expand Down

0 comments on commit 13ba02b

Please sign in to comment.