Skip to content

Commit

Permalink
Upgrade bot to be compatible with PyGithub
Browse files Browse the repository at this point in the history
  • Loading branch information
vsc46128 vscuser committed Oct 20, 2023
1 parent 532b6ea commit 5923915
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions connections/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#

# Standard library imports
import datetime
from datetime import datetime, timezone
import time

# Third party imports (anything installed into the local Python environment)
Expand Down Expand Up @@ -101,7 +101,7 @@ def get_instance():
global _gh, _token
# TODO Possibly renew token already if expiry date is soon, not only
# after it has expired.
if not _gh or (_token and datetime.datetime.utcnow() > _token.expires_at):
if not _gh or (_token and datetime.now(timezone.utc) > _token.expires_at):
_gh = connect()
return _gh

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PyGithub
PyGithub>=2.1.1
Waitress
cryptography
PyGHee>=0.0.3
Expand Down

0 comments on commit 5923915

Please sign in to comment.