ps: handle zero tables case

This commit is contained in:
Oleksii Shevchuk 2018-10-04 11:32:12 +03:00
parent 8e3dccc4da
commit 88f6fd1478
1 changed files with 4 additions and 3 deletions

View File

@ -181,9 +181,10 @@ def print_psinfo(fout, families, socktypes, data, colinfo, sections=[], wide=Fal
else:
for section, table in infosecs.iteritems():
labels = sorted(table[0], cmp=sorter)
parts.append(TruncateToTerm(Table(
table, labels, Color(section.upper(), 'yellow'))))
if table:
labels = sorted(table[0], cmp=sorter)
parts.append(TruncateToTerm(Table(
table, labels, Color(section.upper(), 'yellow'))))
fout(MultiPart(parts))