fix: avoid deleting items while iterating (#772)
Updates `google.auth.external_account.Credentials#info` to not delete items in the dictionary while iterating.
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 @@
"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):