summaryrefslogtreecommitdiff
path: root/numpy/lib/_iotools.py
diff options
context:
space:
mode:
authorAron Ahmadia <aron@ahmadia.net>2012-07-17 16:59:50 -0500
committerAron Ahmadia <aron@ahmadia.net>2012-07-17 16:59:50 -0500
commita419a3036aa8202d00eb6e857c79d66adc56bed0 (patch)
tree4a73e6fff2ee13b35c154c43bd7b58bb6c2af633 /numpy/lib/_iotools.py
parent7316499dd60baa7bb260875b79f7d22be491c986 (diff)
parent6c772fab57934d24b66638ea5001eb02d1662f5e (diff)
downloadnumpy-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.py11
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