From 1853dddb61ef6a947134fe5ed0f3981ce4f1b107 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 18 May 2022 16:30:03 +0200 Subject: [PATCH] Allow to disable validation --- drafthorse/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drafthorse/utils.py b/drafthorse/utils.py index 299e14d..913830f 100644 --- a/drafthorse/utils.py +++ b/drafthorse/utils.py @@ -33,7 +33,8 @@ def validate_xml(xmlout, schema): except ImportError: logger.warning("Could not validate output as LXML is not installed.") return xmlout - schema = etree.XMLSchema(file=os.path.join(os.path.dirname(__file__), 'schema', schema + '.xsd')) + if schema is not None: + schema = etree.XMLSchema(file=os.path.join(os.path.dirname(__file__), 'schema', schema + '.xsd')) parser = etree.XMLParser(schema=schema) xml_root = etree.fromstring(xmlout, parser) return b"" + etree.tostring(xml_root, pretty_print=True) -- 2.47.3