fix: Pass pre-commit check

This commit is contained in:
Mike A.
2024-09-03 17:20:00 +02:00
parent 693c7c4657
commit 11cb2acf30

View File

@@ -734,7 +734,7 @@ class AsyncAppleAccount(BaseAppleAccount):
msg = "Email verification failed: " + r["Status"].get("em") msg = "Email verification failed: " + r["Status"].get("em")
raise InvalidCredentialsError(msg) raise InvalidCredentialsError(msg)
sp = r.get("sp") sp = r.get("sp")
if sp not in ["s2k", "s2k_fo"]: if not isinstance(sp, str) or sp not in {"s2k", "s2k_fo"}:
msg = f"This implementation only supports s2k and sk2_fo. Server returned {sp}" msg = f"This implementation only supports s2k and sk2_fo. Server returned {sp}"
raise UnhandledProtocolError(msg) raise UnhandledProtocolError(msg)