Skip to content

Commit

Permalink
git-p4: use dict.items() iteration for python3 compatibility
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
yangskyboxlabs authored and gitster committed Jan 15, 2020
1 parent a6b1306 commit 2e2aa8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 2e2aa8d

Please sign in to comment.