← Back to team overview

launchpad-reviewers team mailing list archive

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

 

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

Commit message:
Don't assume that dict.items() returns a list

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397618
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-dict-items into launchpad:master.
diff --git a/lib/lp/archivepublisher/tests/test_publisher.py b/lib/lp/archivepublisher/tests/test_publisher.py
index d48224a..5afd67a 100644
--- a/lib/lp/archivepublisher/tests/test_publisher.py
+++ b/lib/lp/archivepublisher/tests/test_publisher.py
@@ -482,7 +482,7 @@ class ByHashHasContents(Matcher):
         mismatch = DirContains(self.expected_hashes.keys()).match(by_hash_path)
         if mismatch is not None:
             return mismatch
-        best_hashname, best_hashattr = self.expected_hashes.items()[-1]
+        best_hashname, best_hashattr = list(self.expected_hashes.items())[-1]
         for hashname, hashattr in self.expected_hashes.items():
             digests = {
                 getattr(hashlib, hashattr)(content).hexdigest(): content
diff --git a/lib/lp/registry/browser/product.py b/lib/lp/registry/browser/product.py
index 36109fe..171f7a3 100644
--- a/lib/lp/registry/browser/product.py
+++ b/lib/lp/registry/browser/product.py
@@ -2521,7 +2521,7 @@ class ProjectAddStepTwo(StepView, ProductLicenseMixin, ReturnToReferrerMixin):
                 [self.source_package_name])
             if len(release_list) != 0:
                 self.widgets['licenses'].source_package_release = (
-                    release_list.items()[0][1])
+                    list(release_list.items())[0][1])
 
     @property
     def source_package_name(self):
diff --git a/lib/lp/services/webapp/tests/test_login.py b/lib/lp/services/webapp/tests/test_login.py
index b110149..18dc989 100644
--- a/lib/lp/services/webapp/tests/test_login.py
+++ b/lib/lp/services/webapp/tests/test_login.py
@@ -784,7 +784,7 @@ class ForwardsCorrectly:
         request._app_names = ['foo']
         view = StubbedOpenIDLogin(object(), request)
         view()
-        escaped_args = tuple(map(quote, args.items()[0]))
+        escaped_args = tuple(map(quote, list(args.items())[0]))
         expected_fragment = quote('%s=%s' % escaped_args)
         return Contains(
             expected_fragment).match(view.openid_request.return_to)