diff options
| author | Chuck Short <chuck.short@canonical.com> | 2013-10-06 22:39:41 -0400 |
|---|---|---|
| committer | Chuck Short <chuck.short@canonical.com> | 2013-10-11 09:04:49 -0400 |
| commit | b0b8afaf55ffdadf5ee329edd92b9cac1be8c2d1 (patch) | |
| tree | 11b7d97b5ba1f68d1b55498ef6a496748a4124a2 /tools | |
| parent | 4a507601d7dded2efb1bd2e885155ba38db9538c (diff) | |
| download | python-cinderclient-b0b8afaf55ffdadf5ee329edd92b9cac1be8c2d1.tar.gz | |
python3: Refactor dict for python2/python3 compat
Python3 changed the behavior of dict.keys such that it is now
returns a dict_keys object, which is iterable but not indexable.
You can get the python2 result back with an explicit call to list.
Refactor list(*.keys()) so that it just uses list().
Change-Id: Ib2e9646ac967e9bd7cc4f47e2099f5d1358808a9
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/colorizer.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/colorizer.py b/tools/colorizer.py index 1b6e576..2a079fc 100755 --- a/tools/colorizer.py +++ b/tools/colorizer.py @@ -267,7 +267,7 @@ class NovaTestResult(testtools.TestResult): if not self.last_written or (self._now() - time).total_seconds() > 2.0: diff = 3.0 while diff > 2.0: - classes =list(self.results.keys()) + classes =list(self.results) oldest = min(classes, key=lambda x: self.last_time[x]) diff = (self._now() - self.last_time[oldest]).total_seconds() self.writeTestCase(oldest) |
