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)