Skip to content

Commit

Permalink
Also catch FileNotFoundError when detecting multiarch (#159)
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 authored Jun 13, 2024
1 parent 6575f2a commit d4fe6ba
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 d4fe6ba

Please sign in to comment.