Skip to content

Commit 49215c6

Browse files
ktbarrettdolfinus
authored andcommitted
Fix Python <3.9
1 parent b602118 commit 49215c6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/test_integration/test_archival.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def test_version_from_archival_applies_tag_formatter(tmp_path: Path) -> None:
317317
)
318318
version = version_from_archival(
319319
tmp_path,
320-
tag_formatter=lambda tag: tag.removeprefix("release/"),
320+
tag_formatter=lambda tag: tag[len("release/") :] if tag.startswith("release/") else tag,
321321
)
322322
assert version == Version("1.2.3")
323323

@@ -430,7 +430,7 @@ def test_archival_end_to_end_tag_formatter(repo: Path, tmp_path_factory: pytest.
430430
create_file(
431431
repo,
432432
"util.py",
433-
"def tag_formatter(tag):\n return tag.removeprefix('release/')\n",
433+
"def tag_formatter(tag):\n return tag[len('release/'):] if tag.startswith('release/') else tag\n",
434434
)
435435
create_config(
436436
repo,

0 commit comments

Comments
 (0)