attempt to fix intermittent disconnections due to AttributeError when decoding

master
mutantmonkey 2011-09-23 19:31:48 -04:00
parent 4c64beada2
commit 95ad79b5ec
1 changed files with 2 additions and 0 deletions

2
bot.py
View File

@ -22,6 +22,8 @@ def decode(bytes):
text = bytes.decode('iso-8859-1')
except UnicodeDecodeError:
text = bytes.decode('cp1252')
except AttributeError:
return bytes
return text
class Phenny(irc.Bot):