Skip to content

Commit

Permalink
fix XML typing
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault committed Nov 3, 2023
1 parent 8d9fc48 commit 25be10b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions weaver/xml_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down

0 comments on commit 25be10b

Please sign in to comment.