Fix Python 3 incompatibility in table outputter

`map(None, some_iterable)` is not valid usage in Python 3. This fixes
that incompatiblity in a way that works in both Python 2 and 3.
This commit is contained in:
Erik Johnson 2018-05-16 00:03:47 -05:00
parent d729656703
commit 43e3dcd398
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -148,7 +148,7 @@ class TableDisplay(object):
for item in row
]
rows = []
for item in map(None, *new_rows):
for item in map(lambda *args: args, *new_rows):
if isinstance(item, (tuple, list)):
rows.append([substr or '' for substr in item])
else:
@ -160,7 +160,7 @@ class TableDisplay(object):
for row in rows
]
columns = map(None, *reduce(operator.add, logical_rows))
columns = map(lambda *args: args, *reduce(operator.add, logical_rows))
max_widths = [
max([len(six.text_type(item)) for item in column])