Skip to content

Commit eb9d13a

Browse files
committed
PR: Fix build.
1 parent af61fac commit eb9d13a

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

google_auth_httplib2.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@
2121
from google.auth import exceptions
2222
from google.auth import transport
2323
import httplib2
24+
from six.moves import http_client # httplib became http.client in 3.
2425

25-
# httplib became http.client in 3.x
26-
try:
27-
from http.client import HTTPException
28-
except ImportError:
29-
from httplib import HTTPException
3026

3127
_LOGGER = logging.getLogger(__name__)
3228
# Properties present in file-like streams / buffers.
@@ -120,9 +116,9 @@ def __call__(self, url, method='GET', body=None, headers=None,
120116
response, data = self.http.request(
121117
url, method=method, body=body, headers=headers, **kwargs)
122118
return _Response(response, data)
123-
# TODO: httplib2 should catch the lower http error, this is a bug and
119+
# httplib2 should catch the lower http error, this is a bug and
124120
# needs to be fixed there. Catch the error for the meanwhile.
125-
except (httplib2.HttpLib2Error, HTTPException) as exc:
121+
except (httplib2.HttpLib2Error, http_client.HTTPException) as exc:
126122
raise exceptions.TransportError(exc)
127123

128124

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
DEPENDENCIES = (
2121
'google-auth',
2222
'httplib2 >= 0.9.1',
23+
'six'
2324
)
2425

2526

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = lint,py27,py34,py35,py36,pypy,cover
2+
envlist = lint,py27,py36,cover
33

44
[testenv]
55
deps =
@@ -21,7 +21,7 @@ deps =
2121
{[testenv]deps}
2222

2323
[testenv:lint]
24-
basepython = python3.5
24+
basepython = python3.6
2525
commands =
2626
python setup.py check --metadata --restructuredtext --strict
2727
flake8 \

0 commit comments

Comments
 (0)