Skip to content

Commit

Permalink
Handle PosixPath and MultiplexedPath to string representations
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhamer-noaa committed Jun 26, 2024
1 parent d6d7258 commit 3d75991
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/idsse_testing/utilities/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import csv
import json
import pathlib

from collections.abc import Sequence
from importlib import resources
Expand All @@ -33,7 +34,10 @@ def get_package_path(package: str) -> str:
Returns:
str: The package path from the installed package
"""
return str(resources.files(package)._paths[0])
path = resources.files(package)
if isinstance(path, pathlib.PosixPath):
return str(path)
return str(path._paths[0])

def get_filepath(package: str, filename: str) -> str:
"""Get file path from package/filename
Expand Down

0 comments on commit 3d75991

Please sign in to comment.