mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +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
@@ -1647,7 +1647,7 @@ Output:
|
||||
# as the actual value of the attribute in LDAP.
|
||||
for attr, value in attrs.items():
|
||||
if isinstance(value, str) and value.startswith("file:"):
|
||||
with open(value[5:], "rb") as f:
|
||||
with open(value.removeprefix("file:"), "rb") as f:
|
||||
attrs[attr] = [f.read()]
|
||||
|
||||
ldap_patcher = mock.patch("django_auth_ldap.config.ldap.initialize")
|
||||
|
||||
Reference in New Issue
Block a user