Handle cols being zero

This commit is contained in:
Kovid Goyal 2018-02-27 18:48:48 +05:30
parent 740a89b77f
commit e8f3f00792
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -207,7 +207,7 @@ class Table:
col_width = longest + 2 col_width = longest + 2
col_width = min(col_width, 40) col_width = min(col_width, 40)
space_for_desc = col_width - 2 - idx_size - 4 space_for_desc = col_width - 2 - idx_size - 4
num_cols = self.num_cols = cols // col_width num_cols = self.num_cols = max(cols // col_width, 1)
buf = [] buf = []
a = buf.append a = buf.append
rows_left = rows rows_left = rows