Skip to content

Commit

Permalink
Fix exception when looking for gz executable
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Ferigo <diego.ferigo@iit.it>
  • Loading branch information
flferretti and diegoferigo committed May 17, 2024
1 parent 1c385e0 commit f19d41c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/rod/utils/gazebo.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def has_gazebo() -> bool:
try:
_ = GazeboHelper.get_gazebo_executable()
return True
except:
except Exception:
return False

@staticmethod
Expand Down Expand Up @@ -108,10 +108,11 @@ def process_model_description_with_sdformat(
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
check=True,
)
except subprocess.CalledProcessError as e:
if cp.returncode != 0:
print(cp.stdout)
if e.returncode != 0:
print(e.stdout)
raise RuntimeError(
"Failed to process the input with sdformat"
) from e
Expand Down
2 changes: 1 addition & 1 deletion src/rod/utils/resolve_uris.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def resolve_local_uri(uri: str) -> pathlib.Path:

try:
return resolve_robotics_uri_py.resolve_robotics_uri(uri=uri)
except:
except FileNotFoundError:
pass

# Remove the prefix of the URI
Expand Down

0 comments on commit f19d41c

Please sign in to comment.