[llvm] r350312 - Python compat - iteritems() vs. items()
Serge Guelton via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 3 06:12:23 PST 2019
Author: serge_sans_paille
Date: Thu Jan 3 06:12:23 2019
New Revision: 350312
URL: http://llvm.org/viewvc/llvm-project?rev=350312&view=rev
Log:
Python compat - iteritems() vs. items()
Always use `items()` and introduce extra `list(...)` call when needed.
Differential Revision: https://reviews.llvm.org/D56257
Modified:
llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py
llvm/trunk/utils/Reviewing/find_interesting_reviews.py
llvm/trunk/utils/docker/scripts/llvm_checksum/llvm_checksum.py
Modified: llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py?rev=350312&r1=350311&r2=350312&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py (original)
+++ llvm/trunk/test/tools/llvm-readobj/Inputs/relocs.py Thu Jan 3 06:12:23 2019
@@ -75,7 +75,7 @@ class EnumType(type):
def makeKey(item):
return (item[1], item[0])
e = []
- for pair in sorted(self._nameMap.iteritems(), key=makeKey):
+ for pair in sorted(self._nameMap.items(), key=makeKey):
e.append(pair)
return e
Modified: llvm/trunk/utils/Reviewing/find_interesting_reviews.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/Reviewing/find_interesting_reviews.py?rev=350312&r1=350311&r2=350312&view=diff
==============================================================================
--- llvm/trunk/utils/Reviewing/find_interesting_reviews.py (original)
+++ llvm/trunk/utils/Reviewing/find_interesting_reviews.py Thu Jan 3 06:12:23 2019
@@ -52,10 +52,10 @@ class PhabObjectCache:
return self.id2PhabObjects[id]
def get_ids_in_cache(self):
- return self.id2PhabObjects.keys()
+ return list(self.id2PhabObjects.keys())
def get_objects(self):
- return self.id2PhabObjects.values()
+ return list(self.id2PhabObjects.values())
DEFAULT_DIRECTORY = "PhabObjectCache"
Modified: llvm/trunk/utils/docker/scripts/llvm_checksum/llvm_checksum.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/docker/scripts/llvm_checksum/llvm_checksum.py?rev=350312&r1=350311&r2=350312&view=diff
==============================================================================
--- llvm/trunk/utils/docker/scripts/llvm_checksum/llvm_checksum.py (original)
+++ llvm/trunk/utils/docker/scripts/llvm_checksum/llvm_checksum.py Thu Jan 3 06:12:23 2019
@@ -183,7 +183,7 @@ def ValidateChecksums(reference_checksum
if len(new_checksums) != len(reference_checksums):
return False
- for proj, checksum in new_checksums.iteritems():
+ for proj, checksum in new_checksums.items():
# We never computed a checksum for this project.
if proj not in reference_checksums:
return False
More information about the llvm-commits
mailing list