tIf the text is empty, do not throw exception. - zs - Zeitungsschau rss to email converter
(HTM) git clone git://r-36.net/zs
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 4010b280ba3871965b852aad19c26f9331e861bd
(DIR) parent 01445b45c7a7c31d732339989a71c957a633bad6
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 10 Feb 2018 16:23:57 +0100
If the text is empty, do not throw exception.
Diffstat:
zeitungsschau/feedemail.py | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/zeitungsschau/feedemail.py b/zeitungsschau/feedemail.py
t@@ -17,6 +17,9 @@ import lxml.html
import html2text
def normalizeheader(hstr):
+ if len(hstr) == 0:
+ return ""
+
return lxml.html.fromstring(hstr).text_content().\
replace(u"\xa0", "").\
replace("\n", " ").strip()