Skip to content

Commit

Permalink
Merge pull request #152 from jiajie-chen/issue/151-gcs-cred
Browse files Browse the repository at this point in the history
Fix for Issue #151 - Google Credentials isinstance check
  • Loading branch information
martindurant committed Jun 12, 2019
2 parents 991ccfb + 3d907dc commit 8923fc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from base64 import b64encode, b64decode
import google.auth as gauth
import google.auth.compute_engine
import google.auth.credentials
from google.auth.transport.requests import AuthorizedSession
from google.auth.exceptions import GoogleAuthError
from google.oauth2.credentials import Credentials
Expand Down Expand Up @@ -389,10 +390,10 @@ def _connect_token(self, token):
token = json.load(open(token))
if isinstance(token, dict):
credentials = self._dict_to_credentials(token)
elif isinstance(token, Credentials):
elif isinstance(token, google.auth.credentials.Credentials):
credentials = token
else:
raise ValueError('Token format no understood')
raise ValueError('Token format not understood')
self.session = AuthorizedSession(credentials)

def _connect_service(self, fn):
Expand Down

0 comments on commit 8923fc7

Please sign in to comment.