diff options
Diffstat (limited to 'google/auth/_default_async.py')
-rw-r--r-- | google/auth/_default_async.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/google/auth/_default_async.py b/google/auth/_default_async.py index 3fa125b..fb277c5 100644 --- a/google/auth/_default_async.py +++ b/google/auth/_default_async.py @@ -21,6 +21,8 @@ import io import json import os +import six + from google.auth import _default from google.auth import environment_vars from google.auth import exceptions @@ -61,7 +63,7 @@ def load_credentials_from_file(filename, scopes=None, quota_project_id=None): new_exc = exceptions.DefaultCredentialsError( "File {} is not a valid json file.".format(filename), caught_exc ) - raise new_exc from caught_exc + six.raise_from(new_exc, caught_exc) # The type key should indicate that the file is either a service account # credentials file or an authorized user credentials file. @@ -77,7 +79,7 @@ def load_credentials_from_file(filename, scopes=None, quota_project_id=None): except ValueError as caught_exc: msg = "Failed to load authorized user credentials from {}".format(filename) new_exc = exceptions.DefaultCredentialsError(msg, caught_exc) - raise new_exc from caught_exc + six.raise_from(new_exc, caught_exc) if quota_project_id: credentials = credentials.with_quota_project(quota_project_id) if not credentials.quota_project_id: @@ -94,7 +96,7 @@ def load_credentials_from_file(filename, scopes=None, quota_project_id=None): except ValueError as caught_exc: msg = "Failed to load service account credentials from {}".format(filename) new_exc = exceptions.DefaultCredentialsError(msg, caught_exc) - raise new_exc from caught_exc + six.raise_from(new_exc, caught_exc) return credentials, info.get("project_id") else: |