From 38549feef1a634d2029ba7ff462150c4523cc39e Mon Sep 17 00:00:00 2001 From: Kento HASEGAWA Date: Wed, 28 Aug 2019 23:00:22 +0900 Subject: [PATCH] Fix a bug --- utils/data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/data.py b/utils/data.py index f312ea8..254239b 100644 --- a/utils/data.py +++ b/utils/data.py @@ -355,8 +355,11 @@ class Problem(object): self.solutions[solution_id] = solution if solution.status == 'done': + outdir = f"{self.solution_path}/{self.name}" + if not os.path.exists(outdir): + os.mkdir(outdir) problem_path = self.path - solution_path = f'{self.solution_path}/{self.name}/tmp-{solution.request_id}-{solution.worker}.txt' + solution_path = f'{outdir}/tmp-{solution.request_id}-{solution.worker}.txt' with open(solution_path, 'w') as fp: fp.write(solution.solution) -- 2.22.0