mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Use timezone-aware reset datetime in GithubRetry.py (#2610)
Co-authored-by: Patryk Szulczyk <patryk.szulczyk@skyscanner.net> Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
co-authored by
Patryk Szulczyk
Enrico Minack
parent
5fcb0c7d3b
commit
950a69493f
@@ -137,8 +137,8 @@ class GithubRetry(Retry):
|
||||
if "X-RateLimit-Reset" in response.headers:
|
||||
value = response.headers.get("X-RateLimit-Reset")
|
||||
if value and value.isdigit():
|
||||
reset = self.__datetime.utcfromtimestamp(
|
||||
int(value)
|
||||
reset = self.__datetime.fromtimestamp(
|
||||
int(value), timezone.utc
|
||||
)
|
||||
delta = reset - self.__datetime.now(
|
||||
timezone.utc
|
||||
|
||||
Reference in New Issue
Block a user