Skip to content

Commit

Permalink
fixup! switch from deprecated pkg_resources to importlib_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjnixon committed Apr 19, 2024
1 parent 8d98d06 commit 08eee33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bear/data_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:"):
Expand Down

0 comments on commit 08eee33

Please sign in to comment.