Raise ProtocolError when transparent palette entries follow opaque ones
@@ -286,9 +286,8 @@ def check_palette(palette):
if len(t) == 3:
seen_triple = True
if seen_triple and len(t) == 4:
- raise ValueError(
- "palette entry %d: "
- "all 4-tuples must precede all 3-tuples" % i)
+ raise ProtocolError(
+ "palette entry %d: all 4-tuples must precede all 3-tuples" % i)
for x in t:
if int(x) != x or not(0 <= x <= 255):
raise ValueError(
