diff options
author | Aron Ahmadia <aron@ahmadia.net> | 2012-07-17 16:59:50 -0500 |
---|---|---|
committer | Aron Ahmadia <aron@ahmadia.net> | 2012-07-17 16:59:50 -0500 |
commit | a419a3036aa8202d00eb6e857c79d66adc56bed0 (patch) | |
tree | 4a73e6fff2ee13b35c154c43bd7b58bb6c2af633 /numpy/lib/_iotools.py | |
parent | 7316499dd60baa7bb260875b79f7d22be491c986 (diff) | |
parent | 6c772fab57934d24b66638ea5001eb02d1662f5e (diff) | |
download | numpy-a419a3036aa8202d00eb6e857c79d66adc56bed0.tar.gz |
Merge branch 'master' of https://github.com/numpy/numpy into patch-2
Diffstat (limited to 'numpy/lib/_iotools.py')
-rw-r--r-- | numpy/lib/_iotools.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/numpy/lib/_iotools.py b/numpy/lib/_iotools.py index 7921b4116..2f2a4bc57 100644 --- a/numpy/lib/_iotools.py +++ b/numpy/lib/_iotools.py @@ -203,13 +203,17 @@ class LineSplitter(object): self._handyman = _handyman # def _delimited_splitter(self, line): - line = line.split(self.comments)[0].strip(asbytes(" \r\n")) + if self.comments is not None: + line = line.split(self.comments)[0] + line = line.strip(asbytes(" \r\n")) if not line: return [] return line.split(self.delimiter) # def _fixedwidth_splitter(self, line): - line = line.split(self.comments)[0].strip(asbytes("\r\n")) + if self.comments is not None: + line = line.split(self.comments)[0] + line = line.strip(asbytes("\r\n")) if not line: return [] fixed = self.delimiter @@ -217,7 +221,8 @@ class LineSplitter(object): return [line[s] for s in slices] # def _variablewidth_splitter(self, line): - line = line.split(self.comments)[0] + if self.comments is not None: + line = line.split(self.comments)[0] if not line: return [] slices = self.delimiter |