Test and fix UTC issue with AppInstallationAuth (#2561)

This commit is contained in:
Enrico Minack
2023-06-22 16:15:34 +02:00
committed by GitHub
parent d514222cb1
commit ff3b80f8f1
3 changed files with 64 additions and 2 deletions
+2 -1
View File
@@ -307,7 +307,8 @@ class AppInstallationAuth(Auth, WithRequester["AppInstallationAuth"]):
self.__installation_authorization.expires_at
- TOKEN_REFRESH_THRESHOLD_TIMEDELTA
)
return token_expires_at < datetime.now(timezone.utc)
# to be fixed by https://github.com/PyGithub/PyGithub/pull/1831
return token_expires_at < datetime.now(timezone.utc).replace(tzinfo=None)
def _get_installation_authorization(self) -> InstallationAuthorization:
assert (