mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +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>
(cherry picked from commit 91ade25ba3)
This commit is contained in:
committed by
Tim Abbott
parent
61e6723a51
commit
680f318bc0
@@ -58,7 +58,8 @@ def list_supervisor_processes(
|
||||
for filter_name in filter_names:
|
||||
# zulip-tornado:* matches zulip-tornado:9800 and zulip-tornado
|
||||
if filter_name.endswith(":*") and (
|
||||
name.startswith(filter_name[:-1]) or name == filter_name[:-2]
|
||||
name.startswith(filter_name.removesuffix("*"))
|
||||
or name == filter_name.removesuffix(":*")
|
||||
):
|
||||
match = True
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user