From: W. Trevor King Date: Fri, 15 Mar 2013 10:43:29 +0000 (-0400) Subject: error: Fix inheritance typos for HTTPError (ProcessingError -> FeedError) X-Git-Tag: v3.3~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a226ef6caa8b88fde4c6b521044aae42f6403f8e;p=rss2email.git error: Fix inheritance typos for HTTPError (ProcessingError -> FeedError) 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 --- 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