make ValueError's descriptive

pull/55/head
Ivan Pozdeev 2015-08-10 03:14:51 +03:00
parent 14fd0fd2d6
commit 63c9378b8b
1 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ from sys import maxint as INF
def apply_png_predictor(pred, colors, columns, bitspercomponent, data): def apply_png_predictor(pred, colors, columns, bitspercomponent, data):
if bitspercomponent != 8: if bitspercomponent != 8:
# unsupported # unsupported
raise ValueError(bitspercomponent) raise ValueError("Unsupported `bitspercomponent': %d"%bitspercomponent)
nbytes = colors*columns*bitspercomponent//8 nbytes = colors*columns*bitspercomponent//8
i = 0 i = 0
buf = b'' buf = b''
@ -43,7 +43,7 @@ def apply_png_predictor(pred, colors, columns, bitspercomponent, data):
line2 += chr(c) line2 += chr(c)
else: else:
# unsupported # unsupported
raise ValueError(ft) raise ValueError("Unsupported predictor value: %d"%ft)
buf += line2 buf += line2
line0 = line2 line0 = line2
return buf return buf