Don't use dict.iterkeys()

Iterating on a dictionary iterators on its keys, so calling its
iterkeys() method is not needed.

Moreover, the dict.iterkeys() method is gone in Python 3. This change
makes the modified code compatible with Python 3.

Blueprint nova-python3
Change-Id: I140f499d2054bb7d5486e4c61a2f886be6649cbb
This commit is contained in:
Victor Stinner
2015-05-21 14:51:18 -07:00
parent e9c8dfc6b3
commit 51f443ec4e
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -268,7 +268,7 @@ class NovaTestResult(testtools.TestResult):
self.stopTestRun()
def stopTestRun(self):
for cls in list(self.results.iterkeys()):
for cls in list(self.results):
self.writeTestCase(cls)
self.stream.writeln()
self.writeSlowTests()