launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26490
[Merge] ~cjwatson/launchpad:py3-dict-iteration into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-dict-iteration into launchpad:master.
Commit message:
Avoid changing a dict while iterating over it
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/398923
This breaks in Python 3, since dict.items() now returns a view rather than materializing a list up-front.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-dict-iteration into launchpad:master.
diff --git a/lib/lp/bugs/externalbugtracker/bugzilla.py b/lib/lp/bugs/externalbugtracker/bugzilla.py
index 5fa1163..7ab8ac5 100644
--- a/lib/lp/bugs/externalbugtracker/bugzilla.py
+++ b/lib/lp/bugs/externalbugtracker/bugzilla.py
@@ -843,7 +843,7 @@ class BugzillaAPI(Bugzilla):
# As a sanity check, drop any comments that don't belong to the
# bug in remote_bug_id.
- for comment_id, comment in comments.items():
+ for comment_id, comment in list(comments.items()):
if int(comment['bug_id']) != actual_bug_id:
del comments[comment_id]