File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ def _test_google_api_imports():
52
52
except :
53
53
from apiclient .discovery import build # noqa
54
54
from apiclient .errors import HttpError # noqa
55
- from oauth2client .client import GoogleCredentials # noqa
56
55
from oauth2client .client import AccessTokenRefreshError # noqa
57
56
from oauth2client .client import OAuth2WebServerFlow # noqa
58
57
from oauth2client .file import Storage # noqa
@@ -193,7 +192,10 @@ def get_application_default_credentials(self):
193
192
from googleapiclient .discovery import build
194
193
except ImportError :
195
194
from apiclient .discovery import build
196
- from oauth2client .client import GoogleCredentials
195
+ try :
196
+ from oauth2client .client import GoogleCredentials
197
+ except ImportError :
198
+ return None
197
199
198
200
try :
199
201
credentials = GoogleCredentials .get_application_default ()
Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ def _test_imports():
80
80
from apiclient .discovery import build # noqa
81
81
from apiclient .errors import HttpError # noqa
82
82
83
- from oauth2client .client import GoogleCredentials # noqa
84
83
from oauth2client .client import OAuth2WebServerFlow # noqa
85
84
from oauth2client .client import AccessTokenRefreshError # noqa
86
85
@@ -157,12 +156,12 @@ def _check_if_can_get_correct_default_credentials():
157
156
# from the environment the tests are running in.
158
157
# See Issue #13577
159
158
test_requirements ()
160
- from oauth2client .client import GoogleCredentials
161
159
try :
162
160
from googleapiclient .discovery import build
163
161
except ImportError :
164
162
from apiclient .discovery import build
165
163
try :
164
+ from oauth2client .client import GoogleCredentials
166
165
credentials = GoogleCredentials .get_application_default ()
167
166
bigquery_service = build ('bigquery' , 'v2' , credentials = credentials )
168
167
jobs = bigquery_service .jobs ()
You can’t perform that action at this time.
0 commit comments