Thread (1 message) 1 message, 1 author, 2019-12-13
DORMANTno replies REVIEWED: 1 (0M)

1 review trailer.

[PATCH v2 11/14] git-p4: use dict.items() iteration for python3 compatibility

From: Yang Zhao <hidden>
Date: 2019-12-13 23:53:36
Subsystem: the rest · Maintainer: Linus Torvalds

Python3 uses dict.items() instead of .iteritems() to provide
iteratoration over dict.  Although items() is technically less efficient
for python2.7 (allocates a new list instead of simply iterating), the
amount of data involved is very small and the penalty negligible.

Signed-off-by: Yang Zhao <redacted>
Reviewed-by: Ben Keene <redacted>
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index 7deee1b939..b7e31d4738 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1745,7 +1745,7 @@ def prepareSubmitTemplate(self, changelist=None):
                 break
         if not change_entry:
             die('Failed to decode output of p4 change -o')
-        for key, value in change_entry.iteritems():
+        for key, value in change_entry.items():
             if key.startswith('File'):
                 if 'depot-paths' in settings:
                     if not [p for p in settings['depot-paths']
-- 
2.21.0.windows.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help