Coverage for adhoc-cicd-odoo-odoo / odoo / _monkeypatches / lxml.py: 78%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-09 18:15 +0000

1import lxml.html.clean 

2import re 

3 

4from importlib.metadata import version 

5 

6from odoo.tools import parse_version 

7 

8 

9def patch_module(): 

10 # between these versions having a couple data urls in a style attribute 

11 # or style node removes the attribute or node erroneously 

12 if parse_version("4.6.0") <= parse_version(version('lxml')) < parse_version("5.2.0"): 12 ↛ 13line 12 didn't jump to line 13 because the condition on line 12 was never true

13 lxml.html.clean._find_image_dataurls = re.compile(r'data:image/(.+?);base64,').findall