mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Web: Fix Python 3 compatibility.
This commit is contained in:
parent
8a8f380a6b
commit
603f44129d
@ -94,7 +94,7 @@ class Web(callbacks.PluginRegexp):
|
||||
size = conf.supybot.protocols.http.peekSize()
|
||||
text = utils.web.getUrl(url, size=size)
|
||||
if sys.version_info[0] >= 3:
|
||||
text = text.encode('utf8', 'replace')
|
||||
text = text.decode('utf8', 'replace')
|
||||
except utils.web.Error, e:
|
||||
self.log.info('Couldn\'t snarf title of %u: %s.', url, e)
|
||||
return
|
||||
@ -188,7 +188,7 @@ class Web(callbacks.PluginRegexp):
|
||||
size = conf.supybot.protocols.http.peekSize()
|
||||
text = utils.web.getUrl(url, size=size)
|
||||
if sys.version_info[0] >= 3:
|
||||
text = text.encode('utf8', 'replace')
|
||||
text = text.decode('utf8', 'replace')
|
||||
parser = Title()
|
||||
try:
|
||||
parser.feed(text)
|
||||
|
Loading…
Reference in New Issue
Block a user