Strip CR as well as LF to avoid errors on Windows

This commit is contained in:
Sophist
2014-03-24 07:42:40 +00:00
parent 838655a2c8
commit 78d2ebf9a3

View File

@@ -49,7 +49,7 @@ class Testbytes2human(unittest.TestCase):
"""
Compare data generated with sample files
Setting create_test_data to True will generated sample files
from code execution (developper-only, check carefully)
from code execution (developer-only, check carefully)
"""
filename = os.path.join('test', 'data', 'b2h_test_%s.dat' % lang)
testlist = self._create_testlist()
@@ -84,6 +84,6 @@ class Testbytes2human(unittest.TestCase):
def _read_expected_from(self, path):
with open(path, 'rb') as f:
lines = [l.rstrip("\n") for l in f.readlines()]
lines = [l.rstrip("\n").rstrip("\r") for l in f.readlines()]
f.close()
return lines