diff options
Diffstat (limited to 'numpy/lib/_iotools.py')
-rw-r--r-- | numpy/lib/_iotools.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/lib/_iotools.py b/numpy/lib/_iotools.py index 9108b2e4c..f2adcda10 100644 --- a/numpy/lib/_iotools.py +++ b/numpy/lib/_iotools.py @@ -27,6 +27,7 @@ else: _bytes_to_complex = complex _bytes_to_name = str + def _is_string_like(obj): """ Check whether obj behaves like a string. @@ -37,6 +38,7 @@ def _is_string_like(obj): return False return True + def _is_bytes_like(obj): """ Check whether obj behaves like a bytes object. @@ -445,6 +447,7 @@ class ConverterError(Exception): """ pass + class ConverterLockError(ConverterError): """ Exception raised when an attempt is made to upgrade a locked converter. @@ -452,6 +455,7 @@ class ConverterLockError(ConverterError): """ pass + class ConversionWarning(UserWarning): """ Warning issued when a string converter has a problem. @@ -708,7 +712,7 @@ class StringConverter(object): """ self._checked = True try: - self._strict_call(value) + return self._strict_call(value) except ValueError: # Raise an exception if we locked the converter... if self._locked: @@ -728,7 +732,7 @@ class StringConverter(object): self.default = self._initial_default else: self.default = default - self.upgrade(value) + return self.upgrade(value) def iterupgrade(self, value): self._checked = True |