Skip to content
Snippets Groups Projects
Unverified Commit 79e4743f authored by Henri Menke's avatar Henri Menke
Browse files

Compatibility with str.removeprefix

parent 1a1901ee
No related branches found
No related tags found
1 merge request!134Add compatibility for Python 3.6: follow-up
......@@ -129,9 +129,9 @@ def clone_repo(
["git", "branch", "-a"], check=True, capture_output=True
)
branches_list = branches_result.stdout.decode().split("\n")
# strip off 'remotes/origin' (needs Python 3.9):
removeprefix = lambda s, p: s[len(p) :] if s.startswith(p) else s # noqa
branches_list = [
b.strip().removeprefix("remotes/origin/") for b in branches_list
removeprefix(b.strip(), "remotes/origin/") for b in branches_list
]
msg += f"Available branches are {branches_list}"
logging.error(msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment