2323import os
2424import warnings
2525
26- import six
27-
2826from google .auth import environment_vars
2927from google .auth import exceptions
3028import google .auth .transport ._http_client
@@ -124,7 +122,7 @@ def load_credentials_from_file(
124122 new_exc = exceptions .DefaultCredentialsError (
125123 "File {} is not a valid json file." .format (filename ), caught_exc
126124 )
127- six . raise_from ( new_exc , caught_exc )
125+ raise new_exc from caught_exc
128126 return _load_credentials_from_info (
129127 filename , info , scopes , default_scopes , quota_project_id , request
130128 )
@@ -440,7 +438,7 @@ def _get_authorized_user_credentials(filename, info, scopes=None):
440438 except ValueError as caught_exc :
441439 msg = "Failed to load authorized user credentials from {}" .format (filename )
442440 new_exc = exceptions .DefaultCredentialsError (msg , caught_exc )
443- six . raise_from ( new_exc , caught_exc )
441+ raise new_exc from caught_exc
444442 return credentials , None
445443
446444
@@ -454,7 +452,7 @@ def _get_service_account_credentials(filename, info, scopes=None, default_scopes
454452 except ValueError as caught_exc :
455453 msg = "Failed to load service account credentials from {}" .format (filename )
456454 new_exc = exceptions .DefaultCredentialsError (msg , caught_exc )
457- six . raise_from ( new_exc , caught_exc )
455+ raise new_exc from caught_exc
458456 return credentials , info .get ("project_id" )
459457
460458
@@ -500,7 +498,7 @@ def _get_impersonated_service_account_credentials(filename, info, scopes):
500498 filename
501499 )
502500 new_exc = exceptions .DefaultCredentialsError (msg , caught_exc )
503- six . raise_from ( new_exc , caught_exc )
501+ raise new_exc from caught_exc
504502 return credentials , None
505503
506504
@@ -514,7 +512,7 @@ def _get_gdch_service_account_credentials(filename, info):
514512 except ValueError as caught_exc :
515513 msg = "Failed to load GDCH service account credentials from {}" .format (filename )
516514 new_exc = exceptions .DefaultCredentialsError (msg , caught_exc )
517- six . raise_from ( new_exc , caught_exc )
515+ raise new_exc from caught_exc
518516 return credentials , info .get ("project" )
519517
520518
0 commit comments