mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +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
@@ -22,7 +22,7 @@ def process_zcommands(content: str, user_profile: UserProfile) -> dict[str, Any]
|
||||
|
||||
if not content.startswith("/"):
|
||||
raise JsonableError(_("There should be a leading slash in the zcommand."))
|
||||
command = content[1:]
|
||||
command = content.removeprefix("/")
|
||||
|
||||
if command == "ping":
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user