Remove (possibly unneeded) try/except in table.py

This commit is contained in:
moltenmuffins 2020-10-08 19:32:58 +08:00
parent 5daff036fc
commit 9ca660bd13
1 changed files with 4 additions and 7 deletions

View File

@ -488,13 +488,10 @@ class Table(JupyterMixin):
max_column = max( max_column = max(
width for width, allow_wrap in zip(widths, wrapable) if allow_wrap width for width, allow_wrap in zip(widths, wrapable) if allow_wrap
) )
try: second_max_column = max(
second_max_column = max( width if allow_wrap and width != max_column else 0
width if allow_wrap and width != max_column else 0 for width, allow_wrap in zip(widths, wrapable)
for width, allow_wrap in zip(widths, wrapable) )
)
except ValueError:
second_max_column = 0
column_difference = max_column - second_max_column column_difference = max_column - second_max_column
ratios = [ ratios = [
(1 if (width == max_column and allow_wrap) else 0) (1 if (width == max_column and allow_wrap) else 0)