Luke Ross

lxmlmeld

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

Meld-like templating using lxml.

Commit 77ed8049c83df9d90ad8641d2d5f6fda90eb8741

Fix bug.

Committed 15 Feb 2016 by Luke Ross

lxmlmeld/__init__.py

@@ -55,7 +55,8 @@ class Element(etree.ElementBase):
 
         if isinstance(text, (list, tuple)):
             parent = self.getparent()
-            if parent and parent.text and parent.getprevious():
+            if parent is not None and parent.text and \
+                    parent.getprevious() is not None:
                 parent.getprevious().tail += parent.text
                 parent.text = None
             for node in text: