resolve openpyxl deprecation warning
@@ -56,13 +56,18 @@ class XLSXView(Table):
else:
ws = wb[str(self.sheet)]
- for row in ws.iter_rows(range_string=self.range_string,
- row_offset=self.row_offset,
- column_offset=self.column_offset):
+ if self.range_string is not None:
+ rows = ws[self.range_string]
+ else:
+ rows = ws.iter_rows(row_offset=self.row_offset,
+ column_offset=self.column_offset)
+
+ for row in rows:
yield tuple(cell.value for cell in row)
+
try:
wb._archive.close()
- except AttributeError as e:
+ except AttributeError:
# just here in case openpyxl stops exposing an _archive property.
pass
