aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-03-04 17:04:57 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2023-03-04 17:04:57 +0200
commitff2c851225dce45ca03b9be994fccb6e28fdd7c4 (patch)
treec71ed363a6db625ee6d52635b8ba84206e0ecf8b
parentci: add black format check (diff)
downloadpkgdev-ff2c851225dce45ca03b9be994fccb6e28fdd7c4.tar.gz
pkgdev-ff2c851225dce45ca03b9be994fccb6e28fdd7c4.tar.bz2
pkgdev-ff2c851225dce45ca03b9be994fccb6e28fdd7c4.zip
commit: use removeprefix
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--src/pkgdev/scripts/pkgdev_commit.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pkgdev/scripts/pkgdev_commit.py b/src/pkgdev/scripts/pkgdev_commit.py
index bcf6463..c85c7b1 100644
--- a/src/pkgdev/scripts/pkgdev_commit.py
+++ b/src/pkgdev/scripts/pkgdev_commit.py
@@ -765,11 +765,9 @@ def determine_msg_args(options, changes):
args.extend(["-t", options.template])
else:
if options.message_template:
- message = options.message_template.read().splitlines()
+ message: list[str] = options.message_template.read().splitlines()
try:
- # TODO: replace with str.removeprefix when py3.8 support dropped
- if message[0].startswith("*: "):
- message[0] = message[0][3:]
+ message[0] = message[0].removeprefix("*: ")
except IndexError:
commit.error(f"empty message template: {options.message_template.name!r}")
else: