mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +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
@@ -639,7 +639,7 @@ def get_tornado_ports(config_file: configparser.RawConfigParser) -> list[int]:
|
||||
{
|
||||
int(port)
|
||||
for key in config_file.options("tornado_sharding")
|
||||
for port in (key[: -len("_regex")] if key.endswith("_regex") else key).split("_")
|
||||
for port in key.removesuffix("_regex").split("_")
|
||||
}
|
||||
)
|
||||
if not ports:
|
||||
|
||||
Reference in New Issue
Block a user