diff options
author | 2011-04-13 19:34:50 -0400 | |
---|---|---|
committer | 2011-04-13 19:34:50 -0400 | |
commit | 9cf503801a4c812f6948e9d5c43f2ff6061f3ead (patch) | |
tree | 5e9e88556b6bca4844b71d00a1175b1b3e5e09f8 /github3/api.py | |
parent | move api (diff) | |
download | python-github3-9cf503801a4c812f6948e9d5c43f2ff6061f3ead.tar.xz python-github3-9cf503801a4c812f6948e9d5c43f2ff6061f3ead.zip |
hrm
Diffstat (limited to 'github3/api.py')
-rw-r--r-- | github3/api.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/github3/api.py b/github3/api.py index c1f7687..8b30d52 100644 --- a/github3/api.py +++ b/github3/api.py @@ -28,11 +28,12 @@ API_MIME = 'application/vnd.github.v3+json' # ======= def _safe_response(r, error=None): + try: r.raise_for_status() return r except requests.HTTPError: - if r.status_code == 401: + if (r.status_code == 404) or (r.status_code == 401): raise LoginFailed else: raise APIError(error) if error else APIError @@ -47,6 +48,7 @@ def get(*path, **params): api.get('groups', 'id') api.get('accounts', 'verify') """ + url = '{0}{1}'.format(API_URL, '/'.join(map(str, path))) # params = kwargs.get('params', None) |