diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 15:01:52 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 17:38:00 -0600 |
commit | cfd766456368777bcb0d5edabd360b3aeb02d3f8 (patch) | |
tree | b38cd1bf7520faba8e2c0268e85253df7fe1f23f /numpy/core/defchararray.py | |
parent | a4100ba6c440bdf2a2b3cfc31995eb5e009846ee (diff) | |
download | numpy-cfd766456368777bcb0d5edabd360b3aeb02d3f8.tar.gz |
STY: Update exception style, easy ones.
Diffstat (limited to 'numpy/core/defchararray.py')
-rw-r--r-- | numpy/core/defchararray.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/defchararray.py b/numpy/core/defchararray.py index 3facd08fa..850e2dae2 100644 --- a/numpy/core/defchararray.py +++ b/numpy/core/defchararray.py @@ -301,7 +301,7 @@ def multiply(a, i): a_arr = numpy.asarray(a) i_arr = numpy.asarray(i) if not issubclass(i_arr.dtype.type, integer): - raise ValueError, "Can only multiply by integers" + raise ValueError("Can only multiply by integers") out_size = _get_num_chars(a_arr) * max(long(i_arr.max()), 0) return _vec_string( a_arr, (a_arr.dtype.type, out_size), '__mul__', (i_arr,)) @@ -1660,7 +1660,7 @@ def isnumeric(a): unicode.isnumeric """ if _use_unicode(a) != unicode_: - raise TypeError, "isnumeric is only available for Unicode strings and arrays" + raise TypeError("isnumeric is only available for Unicode strings and arrays") return _vec_string(a, bool_, 'isnumeric') def isdecimal(a): @@ -1688,7 +1688,7 @@ def isdecimal(a): unicode.isdecimal """ if _use_unicode(a) != unicode_: - raise TypeError, "isnumeric is only available for Unicode strings and arrays" + raise TypeError("isnumeric is only available for Unicode strings and arrays") return _vec_string(a, bool_, 'isdecimal') @@ -1872,7 +1872,7 @@ class chararray(ndarray): def __array_finalize__(self, obj): # The b is a special case because it is used for reconstructing. if not _globalvar and self.dtype.char not in 'SUbc': - raise ValueError, "Can only create a chararray from string data." + raise ValueError("Can only create a chararray from string data.") def __getitem__(self, obj): val = ndarray.__getitem__(self, obj) |