← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-in-dict-keys into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-in-dict-keys into launchpad:master.

Commit message:
Fix use of In() with dict keys

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/395697

In order for Storm to be able to compile this on Python 3, it needs an actual list rather than a view.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-in-dict-keys into launchpad:master.
diff --git a/lib/lp/bugs/model/bugnotification.py b/lib/lp/bugs/model/bugnotification.py
index dc7e089..911118f 100644
--- a/lib/lp/bugs/model/bugnotification.py
+++ b/lib/lp/bugs/model/bugnotification.py
@@ -274,7 +274,7 @@ class BugNotificationSet:
                 In(BugNotificationFilter.bug_notification_id,
                    [notification.id for notification in notifications]),
                 In(StructuralSubscription.subscriberID,
-                   source_person_id_map.keys()))
+                   list(source_person_id_map)))
         filter_ids = []
         # Record the filters for each source.
         for source_person_id, filter_id, filter_description in filter_data:
@@ -299,7 +299,7 @@ class BugNotificationSet:
                 (BugSubscriptionFilterMute.person_id,
                  BugSubscriptionFilterMute.filter_id),
                 In(BugSubscriptionFilterMute.person_id,
-                   recipient_id_map.keys()),
+                   list(recipient_id_map)),
                 In(BugSubscriptionFilterMute.filter_id, filter_ids))
             for person_id, filter_id in mute_data:
                 if filter_id in recipient_id_map[person_id]['filters']: