Commits

Anonymous committed a7fb551

Turns out None + None throws.

Comments (0)

Files changed (1)

anolislib/processes/filter.py

     for element in selector(ElementTree.getroot()):
         previous = element.getprevious()
         parent = element.getparent()
-        if previous != None:
-            previous.tail = previous.tail + element.tail
-        else:
-            parent.text = parent.text + element.tail
+        if element.tail != None:
+            if previous != None:
+                if previous.tail != None:
+                    previous.tail = previous.tail + element.tail
+                else:
+                    previous.tail = element.tail
+            else:
+                if parent.text != None:
+                    parent.text = parent.text + element.tail
+                else:
+                    parent.text = element.tail
         parent.remove(element)