From: W. Trevor King Date: Tue, 11 Dec 2012 01:07:35 +0000 (-0500) Subject: feed: fix id fallback in Feed._process_entry X-Git-Tag: v3.0~36 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6a85dc823222494d9d2f5cd98efd1a0666b0bd82;p=rss2email.git feed: fix id fallback in Feed._process_entry The old `entry['id'] or _id` raised a KeyError when the entry lacked an ID. The new `entry.get('id', _id)` falls back appropriately. Signed-off-by: W. Trevor King --- diff --git a/rss2email/feed.py b/rss2email/feed.py index 9b129c8..3c6513d 100644 --- a/rss2email/feed.py +++ b/rss2email/feed.py @@ -382,7 +382,7 @@ class Feed (object): # If .trust_guid isn't set, we get back hashes of the content. # Instead of letting these run wild, we put them in context # by associating them with the actual ID (if it exists). - guid = entry['id'] or id_ + guid = entry.get('id', id_) if isinstance(guid, dict): guid = guid.values()[0] if guid in self.seen: