From 37090e111048c1c9da3726912e4db7e7b419ca1e Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Tue, 29 Oct 2024 15:34:05 -0700 Subject: [PATCH] Raise rather than use assert --- .../daf/butler/datastores/file_datastore/retrieve_artifacts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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