Skip to content

Commit ff2c851

Browse files
committed
commit: use removeprefix
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent 3fb45c6 commit ff2c851

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/pkgdev/scripts/pkgdev_commit.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,11 +765,9 @@ def determine_msg_args(options, changes):
765765
args.extend(["-t", options.template])
766766
else:
767767
if options.message_template:
768-
message = options.message_template.read().splitlines()
768+
message: list[str] = options.message_template.read().splitlines()
769769
try:
770-
# TODO: replace with str.removeprefix when py3.8 support dropped
771-
if message[0].startswith("*: "):
772-
message[0] = message[0][3:]
770+
message[0] = message[0].removeprefix("*: ")
773771
except IndexError:
774772
commit.error(f"empty message template: {options.message_template.name!r}")
775773
else:

0 commit comments

Comments
 (0)