Skip to content

Commit

Permalink
Improve interface.
Browse files Browse the repository at this point in the history
Co-authored-by: Maxwell G <[email protected]>
  • Loading branch information
felixfontein and gotmax23 authored Sep 27, 2023
1 parent bf0f8f5 commit 94b39a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/antsibull/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ def feature_freeze_version(spec: str, collection_name: str) -> str:
return _FeatureFreezeVersion(spec, collection_name).compute_new_spec()


def load_constraints_if_exists(filename: str) -> dict[str, SemVerSpec]:
def load_constraints_if_exists(filename: str | os.PathLike[str]) -> dict[str, SemVerSpec]:
"""
Load a constraints file, if it exists.
"""
result: dict[str, SemVerSpec] = {}
if not os.path.exists(filename):
return result
for line in parse_pieces_file(filename):
for line in parse_pieces_file(os.fspath(filename)):
record = [entry.strip() for entry in line.split(":", 1)]
if len(record) < 2:
raise ValueError(
Expand Down

0 comments on commit 94b39a5

Please sign in to comment.