Skip to content

Commit

Permalink
allow Path objects as well as str
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmarshall committed Dec 24, 2024
1 parent 25615b6 commit d7a7f98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dbetto/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PropsStream:

@staticmethod
def get(value):
if isinstance(value, str):
if isinstance(value, (str, Path)):
return PropsStream.read_from(value)

if isinstance(value, (collections.abc.Sequence, types.GeneratorType)):
Expand Down Expand Up @@ -64,7 +64,7 @@ def get(value):
if isinstance(value, Catalog):
return value

if isinstance(value, str):
if isinstance(value, (str, Path)):

Check warning on line 67 in src/dbetto/catalog.py

View check run for this annotation

Codecov / codecov/patch

src/dbetto/catalog.py#L67

Added line #L67 was not covered by tests
return Catalog.read_from(value)

msg = f"Can't get Catalog from value of type {type(value)}"
Expand Down

0 comments on commit d7a7f98

Please sign in to comment.