From a226ef6caa8b88fde4c6b521044aae42f6403f8e Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 15 Mar 2013 06:43:29 -0400 Subject: [PATCH] error: Fix inheritance typos for HTTPError (ProcessingError -> FeedError) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Avoid: Traceback (most recent call last): ... File ".../rss2email/feed.py", line 338, in _check_for_errors raise _error.HTTPError(status=status, feed=self) File ".../rss2email/error.py", line 166, in __init__ super(FeedError, self).__init__(feed=feed, message=message) TypeError: __init__() got an unexpected keyword argument 'feed' HTTPErrors occur when we're fetching a feed, so we don't have the parsed feed instance required by ProcessingErrors. We should use the more general FeedError instead, and use the HTTPError class name in the super() call. Both of changes come from sloppy copy-paste errors while stubbing out lots of similar error classes during the huge 066602ef (rss2email: split massive package into modules, 2012-11-13). Reported-by: Matěj Cepl Signed-off-by: W. Trevor King --- rss2email/error.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rss2email/error.py b/rss2email/error.py index defd8f8..1d17f46 100644 --- a/rss2email/error.py +++ b/rss2email/error.py @@ -160,10 +160,10 @@ class ProcessingError (FeedError): _LOG.warning('=== END HERE ===') -class HTTPError (ProcessingError): +class HTTPError (FeedError): def __init__(self, status, feed, **kwargs): message = 'HTTP status {} fetching feed {}'.format(status, feed) - super(FeedError, self).__init__(feed=feed, message=message) + super(HTTPError, self).__init__(feed=feed, message=message) self.status = status -- 2.26.2