Skip to content

Commit

Permalink
Raise rather than use assert
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Oct 29, 2024
1 parent 1369d19 commit 37090e1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ def calc_relative_paths(
for p in paths:
# It is an error if there is no relative path.
rel = p.relative_to(root)
assert rel is not None
if rel is None:
raise RuntimeError(f"Unexepectedly unable to calculate relative path of {p} to {root}.")

Check warning on line 369 in python/lsst/daf/butler/datastores/file_datastore/retrieve_artifacts.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/daf/butler/datastores/file_datastore/retrieve_artifacts.py#L369

Added line #L369 was not covered by tests
file_to_relative[p] = rel
return file_to_relative

Expand Down

0 comments on commit 37090e1

Please sign in to comment.