# HG changeset patch # User Malcolm Matalka # Date 1588091593 -7200 # Tue Apr 28 18:33:13 2020 +0200 # Node ID e181b79193423a9c4f87f28f38c9ed1003cf98d9 # Parent 168b1bf90b54766abc8013dc098818daf936da7c REFACTOR Simplify a little bit of code diff --git a/feed2maildir/converter.py b/feed2maildir/converter.py --- a/feed2maildir/converter.py +++ b/feed2maildir/converter.py @@ -139,10 +139,7 @@ self.output('Oldtime : {} : Feedtime: {} : Link : {}'.format(oldtime, feedtime, post.link)) - try: # to append the post the the feed-list - new[feedname].append(post) - except: # it is the first one, make a new list - new[feedname] = [post, ] + new.setdefault(feedname, []).append(post) newtimes[feedname] = feedup.strftime('%Y-%m-%d %H:%M:%S %Z') self.output('Feedname : {} : Feedup : {}'.format(feedname, newtimes[feedname]))