Commit d0b0782f authored by Vlad Golubev's avatar Vlad Golubev

Закрытие дескрипторов файлов типа aDOT и cpp

parent 24680000
......@@ -289,7 +289,7 @@ class Parser():
def parse_file(self, filename):
# @todo В случае, если на вход будет подан файл в отличной от UTF-8 кодировке программа работать не будет
gcd_dir_rel_path = os.path.abspath('../../gcd/')
file = open(gcd_dir_rel_path + '/' + filename, encoding='utf-8') # "r")
with open(gcd_dir_rel_path + '/' + filename, encoding='utf-8') as file:
dot = file.read()
self._check_brackets(dot)
......@@ -344,6 +344,7 @@ class Parser():
print(Template(filename=os.path.abspath("../pycomsdk/cpp/template.cpp")).render(preds=preds, morphs=morphs,
sels=sels, states=st,
body=body), file=f)
f.close()
return f
......
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