From a5e6b651aa8ad407ce087fe32f40b46925bae527 Mon Sep 17 00:00:00 2001 From: bojeil-google Date: Wed, 9 Jun 2021 12:27:21 -0700 Subject: [PATCH] fix: avoid deleting items while iterating (#772) Updates `google.auth.external_account.Credentials#info` to not delete items in the dictionary while iterating. --- google/auth/external_account.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/google/auth/external_account.py b/google/auth/external_account.py index e40c6528b..1f3034ac3 100644 --- a/google/auth/external_account.py +++ b/google/auth/external_account.py @@ -142,12 +142,7 @@ def info(self): "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):