| Date: Mon, 22 Jun 2015 18:34:56 +0200
Fix a case where a failed parseiso crashes zeitungsschau.
Diffstat:
zeitungsschau/feed.py | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
--- |
| @@ -141,15 +141,19 @@ def parse(astr):
attrib["file"])
# updated
- if hasattr(entry, "updated"):
- article["updated"] = parseiso(entry.updated,\
- now)
- elif hasattr(entry, "pubDate"):
- article["updated"] = parseiso(entry.pubDate,\
- now)
- elif hasattr(entry, "date"):
- article["updated"] = parseiso(entry.date, now)
- else:
+ try:
+ if hasattr(entry, "updated"):
+ article["updated"] = parseiso(entry.updated,\
+ now)
+ elif hasattr(entry, "pubDate"):
+ article["updated"] = parseiso(entry.pubDate,\
+ now)
+ elif hasattr(entry, "date"):
+ article["updated"] = parseiso(entry.date, now)
+ else:
+ article["updated"] = now
+ except TypeError:
+ # There was some error in parseiso.
article["updated"] = now
# author |