fix: convert dict to list for iteration (#18963)

This commit is contained in:
Suraj Shetty 2019-09-09 13:23:01 +05:30 committed by Nabin Hait
parent 5f59c2ae75
commit f43825e4dd

View File

@ -71,7 +71,7 @@ def remove_empty(d):
Helper function that removes all keys from a dictionary (d), Helper function that removes all keys from a dictionary (d),
that have an empty value. that have an empty value.
""" """
for key in d.keys(): for key in list(d):
if not d[key]: if not d[key]:
del d[key] del d[key]
return d return d