From 59ef5af9e26e654a82fc0f560e18f890d028de46 Mon Sep 17 00:00:00 2001 From: pictuga Date: Fri, 24 Apr 2020 22:12:05 +0200 Subject: [PATCH] feeds: fix bug when deleting attr in html --- morss/feeds.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/morss/feeds.py b/morss/feeds.py index 70dad1c..7bdd3d7 100644 --- a/morss/feeds.py +++ b/morss/feeds.py @@ -401,7 +401,8 @@ class ParserXML(ParserBase): return elif key is not None: - del x.attrib[key] + if key in match.attrib: + del match.attrib[key] else: match.getparent().remove(match)