diff --git a/Tests/test_imagemorph.py b/Tests/test_imagemorph.py index 89a4022ae..cad3caebd 100644 --- a/Tests/test_imagemorph.py +++ b/Tests/test_imagemorph.py @@ -288,13 +288,13 @@ class MorphTests(PillowTestCase): imrgb = Image.new('RGB', (10, 10)) iml = Image.new('L', (10, 10)) - with self.assertRaises(ValueError): + with self.assertRaises(RuntimeError): _imagingmorph.apply(bytes(lut), imrgb.im.id, iml.im.id) - with self.assertRaises(ValueError): + with self.assertRaises(RuntimeError): _imagingmorph.apply(bytes(lut), iml.im.id, imrgb.im.id) - with self.assertRaises(ValueError): + with self.assertRaises(RuntimeError): _imagingmorph.match(bytes(lut), imrgb.im.id) # Should not raise diff --git a/src/_imagingmorph.c b/src/_imagingmorph.c index 0b60e4c80..b700f8482 100644 --- a/src/_imagingmorph.c +++ b/src/_imagingmorph.c @@ -66,12 +66,12 @@ apply(PyObject *self, PyObject* args) if (imgin->type != IMAGING_TYPE_UINT8 || imgin->bands != 1) { - PyErr_SetString(PyExc_ValueError, "Unsupported image type"); + PyErr_SetString(PyExc_RuntimeError, "Unsupported image type"); return NULL; } if (imgout->type != IMAGING_TYPE_UINT8 || imgout->bands != 1) { - PyErr_SetString(PyExc_ValueError, "Unsupported image type"); + PyErr_SetString(PyExc_RuntimeError, "Unsupported image type"); return NULL; } @@ -169,7 +169,7 @@ match(PyObject *self, PyObject* args) if (imgin->type != IMAGING_TYPE_UINT8 || imgin->bands != 1) { - PyErr_SetString(PyExc_ValueError, "Unsupported image type"); + PyErr_SetString(PyExc_RuntimeError, "Unsupported image type"); return NULL; }