[FIX] tools: xpath tail for lxml 5.1.0

see https://github.com/lxml/lxml/commit/cc5ddbb1576d2844262a9d520867608aec956de9

Part-of: odoo/odoo#160842
Co-authored-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Xavier-Do
2024-04-07 10:03:48 +00:00
co-authored by Xavier Morel
parent 81e4f9affb
commit 2d13fa900b
+3
View File
@@ -238,6 +238,9 @@ def apply_inheritance_specs(source, specs_tree, inherit_branding=False, pre_loca
# spec before the sentinel, then remove the sentinel element
sentinel = E.sentinel()
node.addnext(sentinel)
if node.tail is not None: # for lxml >= 5.1
sentinel.tail = node.tail
node.tail = None
add_stripped_items_before(sentinel, spec, extract)
remove_element(sentinel)
elif pos == 'before':