diff mbox

[1/3] pwclient: dict.iteritems() is deprecated in Python 3

Message ID 1445037127-45750-1-git-send-email-computersforpeace@gmail.com
State Superseded
Headers show

Commit Message

Brian Norris Oct. 16, 2015, 11:12 p.m. UTC
Just use dict.items(), since there are few fields and we don't really
care about the extra copying.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 patchwork/bin/pwclient | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mike Frysinger Oct. 16, 2015, 11:16 p.m. UTC | #1
On 16 Oct 2015 16:12, Brian Norris wrote:
> Just use dict.items(), since there are few fields and we don't really
> care about the extra copying.

Reviewed-by: Mike Frysinger <vapier@chromium.org>

> --- a/patchwork/bin/pwclient
> +++ b/patchwork/bin/pwclient
> @@ -237,7 +237,7 @@ def action_info(rpc, patch_id):
>      s = "Information for patch id %d" % (patch_id)
>      print(s)
>      print('-' * len(s))
> -    for key, value in sorted(patch.iteritems()):
> +    for key, value in sorted(patch.items()):

the fact we run it through sorted means we end up with the full list
eventually anyways, so i doubt we'd notice the overhead w/py2.
-mike
diff mbox

Patch

diff --git a/patchwork/bin/pwclient b/patchwork/bin/pwclient
index d2b95e5d148d..236b237ddeb3 100755
--- a/patchwork/bin/pwclient
+++ b/patchwork/bin/pwclient
@@ -237,7 +237,7 @@  def action_info(rpc, patch_id):
     s = "Information for patch id %d" % (patch_id)
     print(s)
     print('-' * len(s))
-    for key, value in sorted(patch.iteritems()):
+    for key, value in sorted(patch.items()):
         print("- %- 14s: %s" % (key, unicode(value).encode("utf-8")))
 
 def action_get(rpc, patch_id):