From 53ba63fcd5fb58899084703ea2297191647eca7b Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 6 Jan 2014 21:19:58 -0800 Subject: [PATCH] Raising proper ValueErrors --- PIL/PyAccess.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PIL/PyAccess.py b/PIL/PyAccess.py index 5f56e2bca..1c1294203 100644 --- a/PIL/PyAccess.py +++ b/PIL/PyAccess.py @@ -61,7 +61,7 @@ class PyAccess(object): :param xy: The pixel coordinate, given as (x, y). :param value: The pixel value. """ - if self.readonly: raise Exception('ValueError') # undone, ImagingError_ValueError + if self.readonly: raise ValueError('Attempt to putpixel a read only image') (x,y) = self.check_xy(xy) return self.set_pixel(x,y,color) @@ -83,8 +83,8 @@ class PyAccess(object): def check_xy(self, xy): (x,y) = xy if not (0 <= x < self.xsize and 0 <= y < self.ysize): - raise Exception('ValueError- pixel location out of range') #undone - return (x,y) + raise ValueError('pixel location out of range') + return xy class _PyAccess32_3(PyAccess):