Luke Ross

lxmlmeld

6 releases git clone https://lukeross.name/projects/lxmlmeld.git/

Meld-like templating using lxml.

Commit 2177993a69b914779a025410f26ad657d7abe599

Bug fixes.

Committed 16 Feb 2016 by Luke Ross

lxmlmeld/__init__.py

@@ -51,7 +51,7 @@ class Element(etree.ElementBase):
             thing.addnext(next_thing)
             thing = next_thing
         thing.getparent().remove(thing)
-        if tail and prev_thing:
+        if tail and prev_thing is not None:
             prev_thing.tail = tail
 
     def replace_child(self, old_element, new_element):
@@ -115,7 +115,7 @@ class Element(etree.ElementBase):
 
     def deparent(self):
         parent = self.getparent()
-        if parent:
+        if parent is not None:
             parent.remove(self)
 
     def _clone_without_own_ns(self):