Use with block for file output
This commit is contained in:
parent
2d2ee2939c
commit
f172ca8672
@ -201,7 +201,7 @@ class OptionListCollection:
|
|||||||
"""
|
"""
|
||||||
Saves the current OptionListCollection to the associated file.
|
Saves the current OptionListCollection to the associated file.
|
||||||
"""
|
"""
|
||||||
file = open(self.filename, "w", encoding="utf-8")
|
with open(self.filename, "w", encoding="utf-8") as file:
|
||||||
file.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
file.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
||||||
file.write('<options>\n')
|
file.write('<options>\n')
|
||||||
|
|
||||||
@ -249,7 +249,6 @@ class OptionListCollection:
|
|||||||
file.write('</module>\n')
|
file.write('</module>\n')
|
||||||
|
|
||||||
file.write('</options>\n')
|
file.write('</options>\n')
|
||||||
file.close()
|
|
||||||
|
|
||||||
def parse(self):
|
def parse(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user