attempt to fix intermittent disconnections due to AttributeError when decoding
This commit is contained in:
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):
|
||||||
|
|||||||
Reference in New Issue
Block a user