diff --git a/python/lsst/daf/butler/datastores/file_datastore/retrieve_artifacts.py b/python/lsst/daf/butler/datastores/file_datastore/retrieve_artifacts.py index 583d4ede16..fd76d0ad45 100644 --- a/python/lsst/daf/butler/datastores/file_datastore/retrieve_artifacts.py +++ b/python/lsst/daf/butler/datastores/file_datastore/retrieve_artifacts.py @@ -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}.") file_to_relative[p] = rel return file_to_relative