aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgit
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cgitize/github.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cgitize/github.py b/cgitize/github.py
index 02057c9..affa0b6 100644
--- a/cgitize/github.py
+++ b/cgitize/github.py
@@ -5,7 +5,7 @@
import logging
-from github import Github, GithubException
+from github import Auth, Github, GithubException
from cgitize.repo import Repo
@@ -13,7 +13,10 @@ from cgitize.repo import Repo
class GitHub:
def __init__(self, username, token):
self._username = username
- self._impl = Github(token)
+ auth = None
+ if token is not None:
+ auth = Auth.Token(token)
+ self._impl = Github(auth=auth)
def get_repo(self, repo):
try: