aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbojeil-google <bojeil-google@users.noreply.github.com>2021-06-09 12:27:21 -0700
committerGitHub <noreply@github.com>2021-06-09 13:27:21 -0600
commita5e6b651aa8ad407ce087fe32f40b46925bae527 (patch)
treedc155dc396474a0f4b1f8bf112147875fb996de0
parentf97499c718af70d17c17e0c58d6381273eceabcd (diff)
downloadgoogle-auth-library-python-a5e6b651aa8ad407ce087fe32f40b46925bae527.tar.gz
fix: avoid deleting items while iterating (#772)
Updates `google.auth.external_account.Credentials#info` to not delete items in the dictionary while iterating.
-rw-r--r--google/auth/external_account.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/google/auth/external_account.py b/google/auth/external_account.py
index e40c652..1f3034a 100644
--- a/google/auth/external_account.py
+++ b/google/auth/external_account.py
@@ -142,12 +142,7 @@ class Credentials(credentials.Scoped, credentials.CredentialsWithQuotaProject):
"client_id": self._client_id,
"client_secret": self._client_secret,
}
- # Remove None fields in the info dictionary.
- for k, v in dict(config_info).items():
- if v is None:
- del config_info[k]
-
- return config_info
+ return {key: value for key, value in config_info.items() if value is not None}
@property
def service_account_email(self):