From 8443ddac659854ed43fcc3caed8e9e44524a4269 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 20 Nov 2024 11:30:43 +0100 Subject: [PATCH] plugin text syntaxes: update exception message to be more explicit when `lxml_html_clean` is missing. --- libervia/backend/plugins/plugin_misc_text_syntaxes.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libervia/backend/plugins/plugin_misc_text_syntaxes.py b/libervia/backend/plugins/plugin_misc_text_syntaxes.py index 05b8a6b1..35eb45a5 100644 --- a/libervia/backend/plugins/plugin_misc_text_syntaxes.py +++ b/libervia/backend/plugins/plugin_misc_text_syntaxes.py @@ -33,11 +33,18 @@ from libervia.backend.tools import xml_tools try: from lxml import html - from lxml.html import clean from lxml import etree except ImportError: raise exceptions.MissingModule( - "Missing module lxml, please download/install it from http://lxml.de/" + 'Missing module "lxml", please download/install it from http://lxml.de/' + ) +try: + from lxml.html import clean +except ImportError: + raise exceptions.MissingModule( + 'Missing module "lxml_html_clean". Please download and install it from ' + 'http://lxml.de/. Note that this is a separate package to install in addition ' + 'to "lxml".' ) log = getLogger(__name__)