diff options
author | Petr Viktorin <pviktori@redhat.com> | 2016-05-06 18:12:02 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-05-30 16:44:08 +0200 |
commit | c192c1ae3e080597995b906d93cc7607ffc605c0 (patch) | |
tree | f46ab040df16785160085f0fa2dbd00180cbcfbc | |
parent | 25560f0e1db0c432de35a2496d9c1f8e63dc3dfd (diff) | |
download | freeipa-c192c1ae3e080597995b906d93cc7607ffc605c0.tar.gz freeipa-c192c1ae3e080597995b906d93cc7607ffc605c0.tar.xz freeipa-c192c1ae3e080597995b906d93cc7607ffc605c0.zip |
ipaldap: Convert dict items to list before iterating
In Python 3, dict.items() returns a view.
When such a view is iterated over, the dict cannot change size.
Part of the work for: https://fedorahosted.org/freeipa/ticket/4985
Reviewed-By: Martin Basti <mbasti@redhat.com>
-rw-r--r-- | ipapython/ipaldap.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 74add512a..9fb7fd3f5 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -456,7 +456,7 @@ class LDAPEntry(collections.MutableMapping): def __delitem__(self, name): name = self._get_attr_name(name) - for (altname, keyname) in self._names.items(): + for (altname, keyname) in list(self._names.items()): if keyname == name: del self._names[altname] |