diff options
| author | robot-piglet <[email protected]> | 2025-10-15 17:10:43 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-10-15 17:37:04 +0300 |
| commit | 02f2036cf3bdca6f72a2c2775ad339cb79f5783c (patch) | |
| tree | 530c731290ef5823f1002661588be683bee0d34a /contrib/python/google-auth/py3/google/auth/_default_async.py | |
| parent | b7df79cb9bce72d51561b4de8a3f20d0a4a739e8 (diff) | |
Intermediate changes
commit_hash:a4bf3892f95e75f5dd7dcf9dd05b909d81ca8185
Diffstat (limited to 'contrib/python/google-auth/py3/google/auth/_default_async.py')
| -rw-r--r-- | contrib/python/google-auth/py3/google/auth/_default_async.py | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/contrib/python/google-auth/py3/google/auth/_default_async.py b/contrib/python/google-auth/py3/google/auth/_default_async.py index 2e53e208875..44bc6719f97 100644 --- a/contrib/python/google-auth/py3/google/auth/_default_async.py +++ b/contrib/python/google-auth/py3/google/auth/_default_async.py @@ -20,6 +20,7 @@ Implements application default credentials and project ID detection. import io import json import os +import warnings from google.auth import _default from google.auth import environment_vars @@ -116,14 +117,16 @@ def _get_gcloud_sdk_credentials(quota_project_id=None): if not os.path.isfile(credentials_filename): return None, None - credentials, project_id = load_credentials_from_file( - credentials_filename, quota_project_id=quota_project_id - ) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + credentials, project_id = load_credentials_from_file( + credentials_filename, quota_project_id=quota_project_id + ) - if not project_id: - project_id = _cloud_sdk.get_project_id() + if not project_id: + project_id = _cloud_sdk.get_project_id() - return credentials, project_id + return credentials, project_id def _get_explicit_environ_credentials(quota_project_id=None): @@ -141,11 +144,14 @@ def _get_explicit_environ_credentials(quota_project_id=None): return _get_gcloud_sdk_credentials(quota_project_id=quota_project_id) if explicit_file is not None: - credentials, project_id = load_credentials_from_file( - os.environ[environment_vars.CREDENTIALS], quota_project_id=quota_project_id - ) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + credentials, project_id = load_credentials_from_file( + os.environ[environment_vars.CREDENTIALS], + quota_project_id=quota_project_id, + ) - return credentials, project_id + return credentials, project_id else: return None, None |
