diff options
Diffstat (limited to 'google/auth/compute_engine/credentials.py')
-rw-r--r-- | google/auth/compute_engine/credentials.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/google/auth/compute_engine/credentials.py b/google/auth/compute_engine/credentials.py index cb4e0f0..b39ac50 100644 --- a/google/auth/compute_engine/credentials.py +++ b/google/auth/compute_engine/credentials.py @@ -21,6 +21,8 @@ Compute Engine using the Compute Engine metadata server. import datetime +import six + from google.auth import _helpers from google.auth import credentials from google.auth import exceptions @@ -112,7 +114,7 @@ class Credentials(credentials.Scoped, credentials.CredentialsWithQuotaProject): ) except exceptions.TransportError as caught_exc: new_exc = exceptions.RefreshError(caught_exc) - raise new_exc from caught_exc + six.raise_from(new_exc, caught_exc) @property def service_account_email(self): @@ -350,7 +352,7 @@ class IDTokenCredentials(credentials.CredentialsWithQuotaProject, credentials.Si id_token = _metadata.get(request, path, params=params) except exceptions.TransportError as caught_exc: new_exc = exceptions.RefreshError(caught_exc) - raise new_exc from caught_exc + six.raise_from(new_exc, caught_exc) _, payload, _, _ = jwt._unverified_decode(id_token) return id_token, datetime.datetime.fromtimestamp(payload["exp"]) |