Skip to content

Commit b04a762

Browse files
stanislavlevinhoefling
authored andcommitted
xmlsec workaround for gh##84
Fixes #96
1 parent bc30efd commit b04a762

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ def load(self, name):
9999

100100
def load_xml(self, name, xpath=None):
101101
"""returns xml.etree"""
102-
root = etree.parse(self.path(name)).getroot()
103-
if xpath is None:
104-
return root
105-
return root.find(xpath)
102+
with open(self.path(name)) as f:
103+
root = etree.parse(f).getroot()
104+
if xpath is None:
105+
return root
106+
return root.find(xpath)
106107

107108
def dump(self, root):
108109
print(etree.tostring(root))

0 commit comments

Comments
 (0)