diff options
author | Garrett-R <garrettreynolds5@gmail.com> | 2014-11-29 23:35:56 -0800 |
---|---|---|
committer | Garrett-R <garrettreynolds5@gmail.com> | 2014-11-30 01:07:15 -0800 |
commit | b82388e32ab4c717fd952fa4b8b0ece5512c9972 (patch) | |
tree | cde6c1fb87c6efdb38808b453297d8772f5fff2d /numpy/lib/_iotools.py | |
parent | 0afa5fc05032cacae38280063544ca5d315d6d1d (diff) | |
download | numpy-b82388e32ab4c717fd952fa4b8b0ece5512c9972.tar.gz |
BUG: Closes #2917: numpy.lib._iotools.StringConverter.upgrade return
numpy.lib._iotools.StringConverter.upgrade should have a return value
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 |