Skip to content

Commit

Permalink
Also catch FileNotFoundError when detecting multiarch
Browse files Browse the repository at this point in the history
When the executable we're trying to invoke doesn't exist at all, we'll
see a FileNotFoundError and not a subprocess.CalledProcessError.
  • Loading branch information
cottsay committed May 31, 2024
1 parent c5452db commit a2d7b1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colcon_ros/task/cmake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ def get_multiarch():
if _multiarch is None:
try:
output = subprocess.check_output(['gcc', '-print-multiarch'])
except subprocess.CalledProcessError:
except (FileNotFoundError, subprocess.CalledProcessError):
pass
else:
_multiarch = output.decode().rstrip()
if _multiarch is None:
try:
output = subprocess.check_output(
['dpkg-architecture', '-qDEB_HOST_MULTIARCH'])
except subprocess.CalledProcessError:
except (FileNotFoundError, subprocess.CalledProcessError):
pass
else:
_multiarch = output.decode().rstrip()
Expand Down

0 comments on commit a2d7b1c

Please # to comment.