Unittests: Fix warnings
- Replace deprecated assertion-aliases - Make sure opened files are properly closed after usage
This commit is contained in:
parent
320bdda6e9
commit
c54c5e5d7e
3 changed files with 263 additions and 247 deletions
|
|
@ -3095,7 +3095,8 @@ def scourString(in_string, options=None):
|
|||
# input is a filename
|
||||
# returns the minidom doc representation of the SVG
|
||||
def scourXmlFile(filename, options=None):
|
||||
in_string = open(filename).read()
|
||||
with open(filename) as f:
|
||||
in_string = f.read()
|
||||
out_string = scourString(in_string, options)
|
||||
return xml.dom.minidom.parseString(out_string.encode('utf-8'))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue