diff --git a/weaver/xml_util.py b/weaver/xml_util.py index 051bd24ca..b0605a281 100644 --- a/weaver/xml_util.py +++ b/weaver/xml_util.py @@ -45,7 +45,8 @@ ParseError = lxml_etree.ParseError # define this type here so that code can use it for actual logic without repeating 'noqa' -XML = lxml_etree._ElementTree # noqa +XML = lxml_etree._Element # noqa +XMLTree = lxml_etree._ElementTree # noqa # save a local reference to method employed by OWSLib directly called _lxml_fromstring = lxml_etree.fromstring @@ -59,7 +60,7 @@ def fromstring(text, parser=XML_PARSER): def parse(source, parser=XML_PARSER): - # type: (Union[str, BufferedReader], lxml_etree.XMLParser) -> XML + # type: (Union[str, BufferedReader], lxml_etree.XMLParser) -> XMLTree return lxml_etree.parse(source, parser=parser) # nosec: B410