Python 3: use six.moves.zip() rather than itertools.izip()
This ensures compatibility with both Python 2 and Python 3. Change-Id: Id9838b7517f939e5ee3e3a8c37ae5ec2e9b1d18b
This commit is contained in:
@@ -14,7 +14,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import itertools
|
|
||||||
import os
|
import os
|
||||||
import six
|
import six
|
||||||
import sys
|
import sys
|
||||||
@@ -56,7 +55,7 @@ def print_list(objs, fields, field_labels, formatters={}, sortby=0):
|
|||||||
return lambda o: getattr(o, field, '')
|
return lambda o: getattr(o, field, '')
|
||||||
|
|
||||||
new_formatters = {}
|
new_formatters = {}
|
||||||
for field, field_label in itertools.izip(fields, field_labels):
|
for field, field_label in six.moves.zip(fields, field_labels):
|
||||||
if field in formatters:
|
if field in formatters:
|
||||||
new_formatters[field_label] = formatters[field]
|
new_formatters[field_label] = formatters[field]
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user