mirror of https://github.com/knative/docs.git
drop removeprefix as it's only available in python3.9 (#4846)
Co-authored-by: Dave Protasowski <dprotaso@gmail.com>
This commit is contained in:
parent
f6f61df0b5
commit
8cf22ed6a4
|
@ -9,9 +9,15 @@ from github import Github
|
||||||
def print_to_stdout(*vargs):
|
def print_to_stdout(*vargs):
|
||||||
print(*vargs, file = sys.stdout)
|
print(*vargs, file = sys.stdout)
|
||||||
|
|
||||||
|
def removeprefix(s, prefix):
|
||||||
|
if s.startswith(prefix):
|
||||||
|
return s[len(prefix):]
|
||||||
|
else:
|
||||||
|
return s[:]
|
||||||
|
|
||||||
def drop_prefix(tag):
|
def drop_prefix(tag):
|
||||||
tag = tag.removeprefix("knative-")
|
tag = removeprefix(tag, "knative-")
|
||||||
tag = tag.removeprefix("v")
|
tag = removeprefix(tag, "v")
|
||||||
return tag
|
return tag
|
||||||
|
|
||||||
def is_major_minor(tag, version):
|
def is_major_minor(tag, version):
|
||||||
|
|
Loading…
Reference in New Issue