ubuntu-advantage: mention that fromisoformat can handle Z suffix in Python >= 3.11
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
parent
26bc08b694
commit
4695078c84
|
@ -328,8 +328,8 @@ class UAInterface:
|
|||
info = await self.get_subscription_status(token)
|
||||
|
||||
# Sometimes, a time zone offset of 0 is replaced by the letter Z. This
|
||||
# is specified in RFC 3339 but not supported by fromisoformat.
|
||||
# See https://bugs.python.org/issue35829
|
||||
# is specified in RFC 3339 but not supported by fromisoformat before
|
||||
# Python 3.11. See https://bugs.python.org/issue35829
|
||||
expiration = dt.fromisoformat(info["expires"].replace("Z", "+00:00"))
|
||||
if expiration.timestamp() <= dt.utcnow().timestamp():
|
||||
raise ExpiredTokenError(token, expires=info["expires"])
|
||||
|
|
Loading…
Reference in New Issue