File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 6363from googleapiclient .model import RawModel
6464from googleapiclient .schema import Schemas
6565from oauth2client .anyjson import simplejson
66+ from oauth2client .client import GoogleCredentials
6667from oauth2client .util import _add_query_parameter
6768from oauth2client .util import positional
6869
@@ -263,8 +264,9 @@ def build_from_document(
263264 # to be used). In this case, the Default Credentials are built and
264265 # used instead of the original credentials. If there are no scopes
265266 # found (meaning the given service requires no authentication), there is
266- # no authorization of the http.
267- if credentials .create_scoped_required ():
267+ # no authorization of the http.
268+ if (isinstance (credentials , GoogleCredentials ) and
269+ credentials .create_scoped_required ()):
268270 scopes = service .get ('auth' , {}).get ('oauth2' , {}).get ('scopes' , {})
269271 if scopes :
270272 credentials = credentials .create_scoped (scopes .keys ())
You can’t perform that action at this time.
0 commit comments