summaryrefslogtreecommitdiff
path: root/numpy/lib/_iotools.py
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2009-02-03 17:11:44 +0000
committerpierregm <pierregm@localhost>2009-02-03 17:11:44 +0000
commit8ab9363953bd9e77bf1bf84c931b426422b90558 (patch)
treecbd42f59969b389d0b254e7f9d0e95e553a3641f /numpy/lib/_iotools.py
parentf278427bb52fdfdc524d1da4032777ca5290e49e (diff)
downloadnumpy-8ab9363953bd9e77bf1bf84c931b426422b90558.tar.gz
* Make sure that StringConverter.update sets the type to object if it can't define it.
Diffstat (limited to 'numpy/lib/_iotools.py')
-rw-r--r--numpy/lib/_iotools.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/numpy/lib/_iotools.py b/numpy/lib/_iotools.py
index 595c01d29..644d83d1c 100644
--- a/numpy/lib/_iotools.py
+++ b/numpy/lib/_iotools.py
@@ -468,6 +468,11 @@ class StringConverter:
for val in missing_values:
self.missing_values.add(val)
else:
- self.missing_values = [] # Update the type
- self.type = self._getsubdtype(func('0'))
+ self.missing_values = []
+ # Update the type
+ try:
+ tester = func('0')
+ except ValueError:
+ tester = None
+ self.type = self._getsubdtype(tester)