def login(self, username, pwd):
try:
self.gh = Github(username, pwd)
# This expression has no effect but will throw an exception if the authentication failed.
self.gh.get_user().id
self.ghapi = self.gh.get_repo(self.repository)
return True
except BadCredentialsException:
return False
评论列表
文章目录