Skip to content

Commit 9b91c91

Browse files
committed
Merge branch 'release/2.15.1'
2 parents f67ec5c + 7e269ec commit 9b91c91

File tree

4 files changed

+31265
-10
lines changed

4 files changed

+31265
-10
lines changed

stl/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__package_name__ = 'numpy-stl'
22
__import_name__ = 'stl'
3-
__version__ = '2.15.0'
3+
__version__ = '2.15.1'
44
__author__ = 'Rick van Hattem'
55
__author_email__ = '[email protected]'
66
__description__ = ' '.join('''

stl/stl.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def load(cls, fh, mode=AUTOMATIC, speedups=True):
7171
name, data = cls._load_ascii(
7272
fh, header, speedups=speedups)
7373
except RuntimeError as exception:
74+
print('exception', exception)
7475
(recoverable, e) = exception.args
7576
# If we didn't read beyond the header the stream is still
7677
# readable through the binary reader
@@ -136,18 +137,13 @@ def _load_binary(cls, fh, header, check_size=False):
136137

137138
@classmethod
138139
def _ascii_reader(cls, fh, header):
139-
recoverable = [True]
140-
line_separator = b'\n'
141-
142-
if b'\r\n' in header:
143-
line_separator = b'\r\n'
144-
elif b'\n' in header:
145-
pass
140+
if b'\n' in header:
141+
recoverable = [True]
146142
else:
147143
recoverable = [False]
148144
header += b(fh.read(BUFFER_SIZE))
149145

150-
lines = b(header).split(line_separator)
146+
lines = b(header).split(b'\n')
151147

152148
def get(prefix=''):
153149
prefix = b(prefix).lower()
@@ -161,7 +157,7 @@ def get(prefix=''):
161157
recoverable[0] = False
162158

163159
# Read more lines and make sure we prepend any old data
164-
lines[:] = b(fh.read(BUFFER_SIZE)).split(line_separator)
160+
lines[:] = b(fh.read(BUFFER_SIZE)).split(b'\n')
165161
raw_line += lines.pop(0)
166162

167163
raw_line = raw_line.strip()

0 commit comments

Comments
 (0)