commit:     ff2c851225dce45ca03b9be994fccb6e28fdd7c4
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  4 15:04:57 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  4 15:04:57 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgdev.git/commit/?id=ff2c8512

commit: use removeprefix

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgdev/scripts/pkgdev_commit.py | 6 ++----
 1 file 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:

Reply via email to