From 6ceec0c5414e1e2880ef73440c5de3a2d729fe48 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 10 Aug 2015 18:16:02 +0200 Subject: [PATCH] Web: HTMLParseError is deprecated/unused since Python 3.3 and removed in Python 3.5. --- plugins/Web/plugin.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/plugins/Web/plugin.py b/plugins/Web/plugin.py index 05d53a070..942b031c3 100644 --- a/plugins/Web/plugin.py +++ b/plugins/Web/plugin.py @@ -44,10 +44,10 @@ from supybot.i18n import PluginInternationalization, internationalizeDocstring _ = PluginInternationalization('Web') if minisix.PY3: - from html.parser import HTMLParser, HTMLParseError + from html.parser import HTMLParser from html.entities import entitydefs else: - from HTMLParser import HTMLParser, HTMLParseError + from HTMLParser import HTMLParser from htmlentitydefs import entitydefs class Title(HTMLParser): @@ -159,11 +159,7 @@ class Web(callbacks.PluginRegexp): except: pass parser = Title() - try: - parser.feed(text) - except HTMLParseError: - self.log.debug('Encountered a problem parsing %u. Title may ' - 'already be set, though', url) + parser.feed(text) if parser.title: domain = utils.web.getDomain(fd.geturl() if self.registryValue('snarferShowTargetDomain', channel) @@ -289,11 +285,7 @@ class Web(callbacks.PluginRegexp): if minisix.PY3 and isinstance(text, bytes): irc.error(_('Could not guess the page\'s encoding. (Try ' 'installing python-charade.)'), Raise=True) - try: - parser.feed(text) - except HTMLParseError: - self.log.debug('Encountered a problem parsing %u. Title may ' - 'already be set, though', url) + parser.feed(text) if parser.title: title = utils.web.htmlToText(parser.title.strip()) if not [y for x,y in optlist if x == 'no-filter']: