Replace dict.iterkeys with six.iterkeys to make PY3 compatible

Python3 do not use dict.iterkeys, which would raise AttributeError:
'dict' object has no attribute 'iterkeys'.

Change-Id: I97e320eac9f2f0b2cb5cf34a1d3fc57e80e440ed
Closes-Bug: #1596124
This commit is contained in:
yuyafei 2016-06-25 11:52:29 +08:00 committed by Kairat Kushaev
parent 4b10efd855
commit 19d8df31fd
1 changed files with 2 additions and 1 deletions

3
tools/colorizer.py Executable file → Normal file
View File

@ -42,6 +42,7 @@
"""Display a subunit stream through a colorized unittest test runner."""
import heapq
import six
import subunit
import sys
import unittest
@ -276,7 +277,7 @@ class SubunitTestResult(testtools.TestResult):
self.stopTestRun()
def stopTestRun(self):
for cls in list(self.results.iterkeys()):
for cls in list(six.iterkeys(self.results)):
self.writeTestCase(cls)
self.stream.writeln()
self.writeSlowTests()