Skip to content

Commit 784dbe9

Browse files
committed
Fix reverse multilink iteration
Adding a reverse multilink to *the same class* would trigger a traceback about a modified dictionary on iteration
1 parent 4b9078c commit 784dbe9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Python v2.5 and v2.6. Starting with the v1.6 releases of Roundup
1111
v2.7.2 or later are required to run newer releases of Roundup. From v2.0
1212
onwards Python 3.4 and later are also supported.
1313

14+
XXXX-XX-XX 2.0.1
15+
16+
Fixed:
17+
- Reverse multilink to *the same class* would trigger a traceback about
18+
a modified dictionary on iteration (Ralf Schlatterbeck)
19+
1420
2020-07-13 2.0.0
1521

1622
Fixed:

roundup/hyperdb.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,9 @@ def post_init(self):
875875
done = getattr(self, 'post_init_done', None)
876876
for cn in self.getclasses():
877877
cl = self.getclass(cn)
878-
for p in cl.properties:
878+
# This will change properties if a back-multilink happens to
879+
# have the same class, so we need to iterate over .keys()
880+
for p in cl.properties.keys():
879881
prop = cl.properties[p]
880882
if not isinstance (prop, (Link, Multilink)):
881883
continue

0 commit comments

Comments
 (0)