8000 Lint fix. · sktt/google-auth-library-python@ae5d3a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae5d3a4

Browse files
committed
Lint fix.
1 parent 895e369 commit ae5d3a4

File tree

5 files changed

+32
-20
lines changed

5 files changed

+32
-20
lines changed

google/auth/_oauth2client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@
2121

2222
from __future__ import absolute_import
2323

24+
import six
25+
2426
from google.auth import _helpers
2527
import google.auth.app_engine
2628
import google.oauth2.credentials
2729
import google.oauth2.service_account
2830

29-
import six
3031
try:
3132
import oauth2client.client
3233
import oauth2client.contrib.gce
3334
import oauth2client.service_account
3435
except ImportError as caught_exc:
35-
new_exc = ImportError('oauth2client is not installed.')
36-
six.raise_from(new_exc, caught_exc)
36+
six.raise_from(
37+
ImportError('oauth2client is not installed.'), caught_exc)
3738

3839
try:
3940
import oauth2client.contrib.appengine

google/auth/transport/grpc.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
try:
2121
import grpc
2222
except ImportError as caught_exc: # pragma: NO COVER
23-
new_exc = ImportError(
24-
'gRPC is not installed, please install the grpcio package to use the '
25-
'gRPC transport.')
26-
six.raise_from(new_exc, caught_exc)
23+
six.raise_from(
24+
ImportError(
25+
'gRPC is not installed, please install the grpcio package '
26+
'to use the gRPC transport.'
27+
),
28+
caught_exc,
29+
)
2730

2831

2932
class AuthMetadataPlugin(grpc.AuthMetadataPlugin):

google/auth/transport/requests.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@
1818

1919
import logging
2020

21-
import six
2221
try:
2322
import requests
2423
except ImportError as caught_exc: # pragma: NO COVER
25-
new_exc = ImportError(
26-
'The requests library is not installed, please install the requests '
27-
'package to use the requests transport.')
28-
six.raise_from(new_exc, caught_exc)
29-
import requests.exceptions
24+
import six
25+
six.raise_from(
26+
ImportError(
27+
'The requests library is not installed, please install the '
28+
'requests package to use the requests transport.'
29+
),
30+
caught_exc,
31+
)
32+
import requests.exceptions # pylint: disable=ungrouped-imports
33+
import six # pylint: disable=ungrouped-imports
3034

3135
from google.auth import exceptions
3236
from google.auth import transport

google/auth/transport/urllib3.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@
3030
except ImportError: # pragma: NO COVER
3131
certifi = None
3232

33-
import six
3433
try:
3534
import urllib3
3635
except ImportError as caught_exc: # pragma: NO COVER
37-
new_exc = ImportError(
38-
'The urllib3 library is not installed, please install the urllib3 '
39-
'package to use the urllib3 transport.')
40-
six.raise_from(new_exc, caught_exc)
41-
import urllib3.exceptions
36+
import six
37+
six.raise_from(
38+
ImportError(
39+
'The urllib3 library is not installed, please install the '
40+
'urllib3 package to use the urllib3 transport.'
41+
),
42+
caught_exc,
43+
)
44+
import six
45+
import urllib3.exceptions # pylint: disable=ungrouped-imports
4246

4347
from google.auth import exceptions
4448
from google.auth import transport

tests/compute_engine/test_credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_refresh_success(self, get, utcnow):
7575
def test_refresh_error(self, get):
7676
get.side_effect = exceptions.TransportError('http error')
7777

78-
with pytest.raises(exceptions.RefreshError) as excinfo:
78+
with pytest.raises(exceptions.RefreshError):
7979
self.credentials.refresh(None)
8080

8181
@mock.patch('google.auth.compute_engine._metadata.get', autospec=True)

0 commit comments

Comments
 (0)
0