From 3e7cb571f2549aa51ed8bfb071392874e2e220b3 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 18 Apr 2013 15:06:18 +0800 Subject: fixes with usage --- generate.py | 1 - lib/utils.py | 2 -- tryprune.py | 2 -- 3 files changed, 5 deletions(-) diff --git a/generate.py b/generate.py index 649f967..4c931af 100755 --- a/generate.py +++ b/generate.py @@ -43,7 +43,6 @@ def generateOneText(infile, modelfile, reportfile): print('found error report') with open(reportfile, 'ab') as f: f.writelines(lines) - f.close() (pid, status) = os.waitpid(subprocess.pid, 0) if status != 0: diff --git a/lib/utils.py b/lib/utils.py index e734ee9..b9343ad 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -23,14 +23,12 @@ class EpochError(Exception): def read_file(infile): with open(infile, 'r') as f: data = ''.join(f.readlines()) - f.close() return data def write_file(outfile, data): with open(outfile, 'w') as f: f.writelines([data]) - f.close() return diff --git a/tryprune.py b/tryprune.py index 27cf69d..6867e76 100755 --- a/tryprune.py +++ b/tryprune.py @@ -41,7 +41,6 @@ def exportModel(modelfile, textmodel): with open(textmodel, 'wb') as f: f.writelines(subprocess.stdout.readlines()) - f.close() (pid, status) = os.waitpid(subprocess.pid, 0) if status != 0: @@ -59,7 +58,6 @@ def convertModel(kmm_model, inter_model): with open(inter_model, 'wb') as f: f.writelines(subprocess.stdout.readlines()) - f.close() (pid, status) = os.waitpid(subprocess.pid, 0) if status != 0: -- cgit