Browse Source

if getTexture fails to decompress the data, raise ValueError instead of zlib.error

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
50547665bc
  1. 5
      pyweb/mumble/MumbleCtlIce.py

5
pyweb/mumble/MumbleCtlIce.py

@ -19,7 +19,7 @@ from os.path import exists, join
from os import unlink, name as os_name from os import unlink, name as os_name
from PIL import Image from PIL import Image
from struct import pack, unpack from struct import pack, unpack
from zlib import compress, decompress
from zlib import compress, decompress, error
from mctl import MumbleCtlBase from mctl import MumbleCtlBase
@ -343,7 +343,10 @@ class MumbleCtlIce_118(MumbleCtlBase):
if len(texture) == 0: if len(texture) == 0:
raise ValueError( "No Texture has been set." ); raise ValueError( "No Texture has been set." );
# this returns a list of bytes. # this returns a list of bytes.
try:
decompressed = decompress( texture ); decompressed = decompress( texture );
except error, err:
raise ValueError( err )
# iterate over 4 byte chunks of the string # iterate over 4 byte chunks of the string
imgdata = ""; imgdata = "";
for idx in range( 0, len(decompressed), 4 ): for idx in range( 0, len(decompressed), 4 ):

Loading…
Cancel
Save