Skip to content

Commit 1affd01

Browse files
committed
Fix dict being changed during iteration
.. for python3: simply using .keys() is not enough.
1 parent 45f5645 commit 1affd01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

roundup/hyperdb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,9 @@ def post_init(self):
954954
for cn in self.getclasses():
955955
cl = self.getclass(cn)
956956
# This will change properties if a back-multilink happens to
957-
# have the same class, so we need to iterate over .keys()
958-
for p in cl.properties.keys():
957+
# have the same class, so we need to iterate over a list made
958+
# from .keys()
959+
for p in list(cl.properties.keys()):
959960
prop = cl.properties[p]
960961
if not isinstance (prop, (Link, Multilink)):
961962
continue

0 commit comments

Comments
 (0)