From 1e9ec2df089973db73aaf99b4ef147efd4614e7c Mon Sep 17 00:00:00 2001 From: AKFish Date: Wed, 21 Aug 2013 23:04:07 +0800 Subject: [PATCH] Add NotModifiedException class --- github/GithubException.py | 6 ++++++ github/GithubObject.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/github/GithubException.py b/github/GithubException.py index 12c9af62..53e2d302 100644 --- a/github/GithubException.py +++ b/github/GithubException.py @@ -5,6 +5,7 @@ # Copyright 2012 Vincent Jacques # # Copyright 2012 Zearin # # Copyright 2013 Vincent Jacques # +# Copyright 2013 AKFish # # # # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # # # @@ -76,3 +77,8 @@ class RateLimitExceededException(GithubException): """ Exception raised when the rate limit is exceeded (when Github API replies with a 403 rate limit exceeded HTML status) """ + +class NotModifiedException(GithubException): + """ + Exception raised when conditional request is made to a resoure that has not changed + """ diff --git a/github/GithubObject.py b/github/GithubObject.py index ae71cf7c..6c68ce1f 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -157,7 +157,7 @@ class GithubObject(object): self._storeAndUseAttributes(data) self.__completed = True return True - except: #GithubException.NotModifiedException: + except GithubException.NotModifiedException: return False class NonCompletableGithubObject(GithubObject):