Skip to content

Commit

Permalink
Fix: Fix type of lxml Element
Browse files Browse the repository at this point in the history
lxml.etree.Element is actually a function to create an _Element class
instance. Therefore update the xml code to use _Element as Element.
  • Loading branch information
bjoernricks authored and greenbonebot committed Jun 14, 2024
1 parent 14e9bf2 commit 3bc26a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gvm/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

import defusedxml.lxml as secET
from defusedxml import DefusedXmlException
from lxml.etree import Element, LxmlError, SubElement, XMLParser
from lxml.etree import Element as create_element
from lxml.etree import LxmlError, SubElement, XMLParser
from lxml.etree import _Element as Element
from lxml.etree import iselement as isxmlelement
from lxml.etree import tostring as xmltostring

Expand Down Expand Up @@ -63,7 +65,7 @@ def __str__(self):

class XmlCommand(XmlCommandElement):
def __init__(self, name):
super().__init__(Element(name))
super().__init__(create_element(name))


def pretty_print(
Expand Down

0 comments on commit 3bc26a8

Please sign in to comment.