From 11df697b96e5e713dd3fef6837911f6b7e450d17 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 4 Aug 2012 20:43:11 +0200 Subject: [PATCH] RSS: Be compatible with new versions of feedparser. --- plugins/RSS/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/RSS/plugin.py b/plugins/RSS/plugin.py index c43ed2fa3..f8e766cbd 100644 --- a/plugins/RSS/plugin.py +++ b/plugins/RSS/plugin.py @@ -31,7 +31,6 @@ import time import types import socket -import sgmllib import threading import supybot.conf as conf @@ -45,7 +44,8 @@ from supybot.i18n import PluginInternationalization, internationalizeDocstring _ = PluginInternationalization('RSS') try: - feedparser = utils.python.universalImport('feedparser', 'local.feedparser') + feedparser = utils.python.universalImport('feedparser.feedparser', + 'local.feedparser.feedparser', 'feedparser', 'local.feedparser') except ImportError: raise callbacks.Error, \ 'You the feedparser module installed to use this plugin. ' \ @@ -261,7 +261,7 @@ class RSS(callbacks.Plugin): results = feedparser.parse(url) if 'bozo_exception' in results: raise results['bozo_exception'] - except sgmllib.SGMLParseError: + except feedparser.sgmllib.SGMLParseError: self.log.exception('Uncaught exception from feedparser:') raise callbacks.Error, 'Invalid (unparsable) RSS feed.' except socket.timeout: