mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
d729656703
commit
43e3dcd398
1 changed files with 2 additions and 2 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Reference in a new issue