mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9. https://docs.python.org/3/library/stdtypes.html#str.removeprefix Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ec4539550
commit
91ade25ba3
@@ -186,9 +186,7 @@ def tokenize(text: str, template_format: str | None = None) -> list[Token]:
|
||||
kind = "handlebars_else"
|
||||
elif looking_at_handlebars_start():
|
||||
s = get_handlebars_tag(text, state.i)
|
||||
tag = s[3:-2].split()[0].strip("#")
|
||||
if tag.startswith("*"):
|
||||
tag = tag[1:]
|
||||
tag = s[3:-2].split()[0].strip("#").removeprefix("*")
|
||||
kind = "handlebars_start"
|
||||
elif looking_at_handlebars_end():
|
||||
s = get_handlebars_tag(text, state.i)
|
||||
|
||||
Reference in New Issue
Block a user