From 08eee339e2fbb9fdab6a243f5327ee9dacca54c2 Mon Sep 17 00:00:00 2001 From: Thomas Nixon Date: Fri, 19 Apr 2024 17:16:22 +0100 Subject: [PATCH] fixup! switch from deprecated pkg_resources to importlib_resources --- bear/data_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bear/data_file.py b/bear/data_file.py index b8f1327..231d023 100644 --- a/bear/data_file.py +++ b/bear/data_file.py @@ -15,12 +15,12 @@ def get_path(file_url): # try to find the file in a couple of different places for package, prefix in ("bear", "data/"), ("visr_bear_data", ""): try: - full_path = importlib_resources.files(package) / fname / path + full_path = importlib_resources.files(package) / prefix / path except ModuleNotFoundError: continue if full_path.is_file(): - return full_path + return str(full_path) else: raise Exception(f"resource '{path}' not found") elif file_url.startswith("file:"):