xep_0454: str.removeprefix is available since 3.9

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-03-20 21:34:55 +01:00
parent 06e4e480c1
commit 28d44ecf74
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -121,7 +121,7 @@ class XEP_0454(BasePlugin):
"""Helper to format a HTTPS URL to an AESGCM URI"""
if not url.startswith('https://') or url.find('#') != -1:
raise InvalidURL
return 'aesgcm://' + url.removeprefix('https://') + '#' + fragment
return 'aesgcm://' + url[len('https://'):] + '#' + fragment
@staticmethod
def map_extensions(ext: str) -> str: