From 26402a7e67266a47befe90bb736b4f35ba1d3c8a Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 16 Jul 2011 16:39:33 +0200 Subject: [PATCH] Replace old raise form --- scikits/image/color/colorconv.py | 6 +++--- scikits/image/io/collection.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scikits/image/color/colorconv.py b/scikits/image/color/colorconv.py index 97b3af69..92c9a0cc 100644 --- a/scikits/image/color/colorconv.py +++ b/scikits/image/color/colorconv.py @@ -95,9 +95,9 @@ def convert_colorspace(arr, fromspace, tospace): fromspace = fromspace.upper() tospace = tospace.upper() if not fromspace in fromdict.keys(): - raise ValueError, 'fromspace needs to be one of %s'%fromdict.keys() + raise ValueError('fromspace needs to be one of %s'%fromdict.keys()) if not tospace in todict.keys(): - raise ValueError, 'tospace needs to be one of %s'%todict.keys() + raise ValueError('tospace needs to be one of %s'%todict.keys()) return todict[tospace](fromdict[fromspace](arr)) @@ -108,7 +108,7 @@ def _prepare_colorarray(arr, dtype=np.float32): if arr.ndim != 3 or arr.shape[2] != 3: msg = "the input array must be have a shape == (.,.,3))" - raise ValueError, msg + raise ValueError(msg) return arr.astype(dtype) diff --git a/scikits/image/io/collection.py b/scikits/image/io/collection.py index fb55b1a9..eb265d1e 100644 --- a/scikits/image/io/collection.py +++ b/scikits/image/io/collection.py @@ -128,7 +128,7 @@ class MultiImage(object): if -numframes <= n < numframes: n = n % numframes else: - raise IndexError, "There are only %s frames in the image"%numframes + raise IndexError("There are only %s frames in the image"%numframes) if self.conserve_memory: if not self._cached == n: @@ -289,7 +289,7 @@ class ImageCollection(object): if -num <= n < num: n = n % num else: - raise IndexError, "There are only %s images in the collection"%num + raise IndexError("There are only %s images in the collection"%num) return n def __iter__(self):