]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-p4: use dict.items() iteration for python3 compatibility
authorYang Zhao <yang.zhao@skyboxlabs.com>
Fri, 13 Dec 2019 23:52:45 +0000 (15:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jan 2020 20:53:40 +0000 (12:53 -0800)
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 <yang.zhao@skyboxlabs.com>
Reviewed-by: Ben Keene <seraphire@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py

index 7deee1b93918d8f57ddd0a17fa648306d17dd206..b7e31d47380be4b99f60d165e9402566fd30395b 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -1745,7 +1745,7 @@ class P4Submit(Command, P4UserMap):
                 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']