Skip to content

Commit

Permalink
Merge pull request #41 from cburgess/issue_40
Browse files Browse the repository at this point in the history
Ensure Pathlib object
  • Loading branch information
mtkennerly authored Mar 5, 2021
2 parents 0e04135 + 2256186 commit e6f9b02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions poetry_dynamic_versioning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ def _deep_merge_dicts(base: Mapping, addition: Mapping) -> Mapping:


def _find_higher_file(*names: str, start: Path = None) -> Optional[Path]:
# Note: We need to make sure we get a pathlib object. Many tox poetry
# helpers will pass us a string and not a pathlib object. See issue #40.
if start is None:
start = Path.cwd()
elif not isinstance(start, Path):
start = Path(start)
for level in [start, *start.parents]:
for name in names:
if (level / name).is_file():
Expand Down

0 comments on commit e6f9b02

Please sign in to comment.