[FIX] translate: fix test on lxml node

Specifically, replace `not node.getparent()` by `node.getparent() is None`.
This commit is contained in:
Raphael Collet
2016-06-08 16:25:40 +02:00
parent 87d1c4abd3
commit 5032cdf64b
+1 -1
View File
@@ -234,7 +234,7 @@ class XMLTranslator(object):
node.tag in SKIPPED_ELEMENTS or
node.get("t-translation", "").strip() == "off" or
node.tag == "attribute" and node.get("name") not in TRANSLATED_ATTRS or
not node.getparent() and node.text and '<!DOCTYPE' in node.text
node.getparent() is None and node.text and '<!DOCTYPE' in node.text
):
# do not translate the contents of the node
tail, node.tail = node.tail, None