Commit e0068547 authored by Boris Kocherov's avatar Boris Kocherov

x2t: use with block for open file

parent 2e8fd048
......@@ -168,8 +168,7 @@ class Handler(object):
os.mkdir(output_dir)
output_file_name = os.path.join(output_dir, "body.txt")
config_file = open(config_file_name, "w")
with open(config_file_name, "w") as config_file:
config = {
# 'm_sKey': 'from',
'm_sFileFrom': input_file_name,
......@@ -186,7 +185,6 @@ class Handler(object):
for key, value in config.items():
ElementTree.SubElement(root, key).text = value
ElementTree.ElementTree(root).write(config_file, encoding='utf-8', xml_declaration=True, default_namespace=None, method="xml")
config_file.close()
# run convertion binary
p = Popen(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment