Skip to content

Commit 48de57c

Browse files
committed
removeprefix came along later, but the tests run in 3.8, so let's just be a little friendlier.
1 parent aeb0bab commit 48de57c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test_unused_arguments.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ast
2+
import re
23
import subprocess
34
import textwrap
45
from contextlib import nullcontext
@@ -386,9 +387,8 @@ def test_function_finder(only_top_level, expected):
386387

387388
def get_most_recent_tag() -> str:
388389
return (
389-
subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], text=True)
390-
.strip()
391-
.removeprefix("v")
390+
re.sub("^v", "", subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], text=True)
391+
.strip())
392392
)
393393

394394

0 commit comments

Comments
 (0)