attempt to fix intermittent disconnections due to AttributeError when decoding
parent
4c64beada2
commit
95ad79b5ec
2
bot.py
2
bot.py
|
@ -22,6 +22,8 @@ def decode(bytes):
|
||||||
text = bytes.decode('iso-8859-1')
|
text = bytes.decode('iso-8859-1')
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
text = bytes.decode('cp1252')
|
text = bytes.decode('cp1252')
|
||||||
|
except AttributeError:
|
||||||
|
return bytes
|
||||||
return text
|
return text
|
||||||
|
|
||||||
class Phenny(irc.Bot):
|
class Phenny(irc.Bot):
|
||||||
|
|
Loading…
Reference in New Issue