Sound Check parsing: fix odd-length strings

This commit is contained in:
Adrian Sampson 2013-02-20 22:56:12 -08:00
parent c2a746562a
commit d50fc378bb

View file

@ -194,7 +194,7 @@ def _sc_decode(soundcheck):
try:
soundcheck = soundcheck.replace(' ', '').decode('hex')
soundcheck = struct.unpack('!iiiiiiiiii', soundcheck)
except struct.error:
except (struct.error, TypeError):
# SoundCheck isn't in the format we expect, so return default
# values.
return 0.0, 0.0