[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:
co-authored by
Xavier Morel
parent
81e4f9affb
commit
2d13fa900b
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user