Skip to content

Commit

Permalink
fixed MR py2.7 compatibility issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PydPiper committed Nov 23, 2021
1 parent a802d45 commit 5ba00a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pylightxl/pylightxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def readxl_get_workbook(fn):
ws, address = fulladdress.split('!')
except ValueError:
msg = ('pylightxl - Ill formatted workbook.xml. '
'Skpping NamedRange not containing sheet reference (ex: "Sheet1!A1"): '
'Skipping NamedRange not containing sheet reference (ex: "Sheet1!A1"): '
'{name} - {fulladdress}'.format(name=name, fulladdress=fulladdress))
warnings.warn(msg, UserWarning)
continue
Expand Down
6 changes: 4 additions & 2 deletions test/test_readxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ def test_bad_readxl_workbook_format(self):
msg = ('pylightxl - Ill formatted workbook.xml. '
'Skipping NamedRange not containing sheet reference (ex: "Sheet1!A1"): '
'{name} - {fulladdress}'.format(name='single_nr', fulladdress='$E$6'))
with self.assertWarns(UserWarning, msg=msg):
_ = xl.readxl_get_workbook('./bad_nr_workbook.zip')
if sys.version_info[0] > 2:
# assertWarns only available in py 3.2+
with self.assertWarns(UserWarning, msg=msg):
_ = xl.readxl_get_workbook('./bad_nr_workbook.zip')


class TestReadCSV(TestCase):
Expand Down

0 comments on commit 5ba00a2

Please sign in to comment.