From 70a7e9c83dec2bf6b549dc5c77d30b53afb32457 Mon Sep 17 00:00:00 2001 From: AKFish Date: Thu, 22 Aug 2013 07:45:27 +0800 Subject: [PATCH] Fix update --- github/Consts.py | 2 +- github/Requester.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/github/Consts.py b/github/Consts.py index 2e551756..65b592ac 100644 --- a/github/Consts.py +++ b/github/Consts.py @@ -30,7 +30,7 @@ ################################################################################ def get(dic, key): if key in dic: - return key[dic] + return dic[key] return None diff --git a/github/Requester.py b/github/Requester.py index 215e2c38..a81566ab 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -177,7 +177,7 @@ class Requester: self.DEBUG_ON_RESPONSE(status, responseHeaders, output) if status == 304: - raise GithubException.NotModifiedException(sttatus, output) + raise GithubException.NotModifiedException(status, output) if status >= 400: raise self.__createException(status, output) return responseHeaders, output @@ -282,8 +282,8 @@ class Requester: requestHeaders["Authorization"] = self.__authorizationHeader def __conditional(self, requestHeaders, parameters): - etag = Consts.get(requestHeaders, Consts.REQ_IF_NONE_MATCH) - last_modified = Consts.get(requestHeaders, Consts.REQ_IF_MODIFIED_SINCE) + etag = Consts.get(parameters, Consts.REQ_IF_NONE_MATCH) + last_modified = Consts.get(parameters, Consts.REQ_IF_MODIFIED_SINCE) if etag is not None: requestHeaders[Consts.REQ_IF_NONE_MATCH] = etag del parameters[Consts.REQ_IF_NONE_MATCH]