diff options
Diffstat (limited to 'google/auth/transport/_mtls_helper.py')
-rw-r--r-- | google/auth/transport/_mtls_helper.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/google/auth/transport/_mtls_helper.py b/google/auth/transport/_mtls_helper.py index 1b9b9c2..4dccb10 100644 --- a/google/auth/transport/_mtls_helper.py +++ b/google/auth/transport/_mtls_helper.py @@ -20,6 +20,8 @@ from os import path import re import subprocess +import six + from google.auth import exceptions CONTEXT_AWARE_METADATA_PATH = "~/.secureConnect/context_aware_metadata.json" @@ -80,7 +82,7 @@ def _read_dca_metadata_file(metadata_path): metadata = json.load(f) except ValueError as caught_exc: new_exc = exceptions.ClientCertError(caught_exc) - raise new_exc from caught_exc + six.raise_from(new_exc, caught_exc) return metadata @@ -108,7 +110,7 @@ def _run_cert_provider_command(command, expect_encrypted_key=False): stdout, stderr = process.communicate() except OSError as caught_exc: new_exc = exceptions.ClientCertError(caught_exc) - raise new_exc from caught_exc + six.raise_from(new_exc, caught_exc) # Check cert provider command execution error. if process.returncode != 0: |