From 50547665bc23fffd327da70d1fbca0260a332500 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Thu, 25 Feb 2010 15:13:36 +0100 Subject: [PATCH] if getTexture fails to decompress the data, raise ValueError instead of zlib.error --- pyweb/mumble/MumbleCtlIce.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyweb/mumble/MumbleCtlIce.py b/pyweb/mumble/MumbleCtlIce.py index c6f9c6e..1bfcb7c 100644 --- a/pyweb/mumble/MumbleCtlIce.py +++ b/pyweb/mumble/MumbleCtlIce.py @@ -19,7 +19,7 @@ from os.path import exists, join from os import unlink, name as os_name from PIL import Image from struct import pack, unpack -from zlib import compress, decompress +from zlib import compress, decompress, error from mctl import MumbleCtlBase @@ -343,7 +343,10 @@ class MumbleCtlIce_118(MumbleCtlBase): if len(texture) == 0: raise ValueError( "No Texture has been set." ); # this returns a list of bytes. - decompressed = decompress( texture ); + try: + decompressed = decompress( texture ); + except error, err: + raise ValueError( err ) # iterate over 4 byte chunks of the string imgdata = ""; for idx in range( 0, len(decompressed), 4 ):