Skip to content

Commit

Permalink
xmlsec workaround for gh#xmlsec#84
Browse files Browse the repository at this point in the history
Fixes xmlsec#96
  • Loading branch information
stanislavlevin authored and hoefling committed Aug 20, 2022
1 parent bc30efd commit b9cb814
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ def load(self, name):

def load_xml(self, name, xpath=None):
"""returns xml.etree"""
root = etree.parse(self.path(name)).getroot()
if xpath is None:
return root
return root.find(xpath)
with open(self.path(name)) as f:
root = etree.parse(f).getroot()
if xpath is None:
return root
return root.find(xpath)

def dump(self, root):
print(etree.tostring(root))
Expand Down

0 comments on commit b9cb814

Please sign in to comment.