Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32c5553

Browse files
raising error,rather then check type
1 parent ced77e4 commit 32c5553

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

lib/matplotlib/table.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,14 @@ def _do_cell_alignment(self):
410410

411411
def auto_set_column_width(self, col):
412412

413-
# col is a list of column index
414-
if isinstance(col, list):
415-
for cell in col:
416-
self._autoColumns.append(cell)
417-
# col is just an index
413+
# check for col possibility on iteration
414+
try:
415+
iter(col)
416+
except (TypeError, AttributeError):
417+
self._autoColumns.append(col)
418418
else:
419-
self._autoColumns.append(col)
419+
for cell in col:
420+
self._autoColumns.append(cell)
420421
self.stale = True
421422

422423
def _auto_set_column_width(self, col, renderer):

0 commit comments

Comments
 (0)