From d367046ed14f96e782a053e0eb4be996639897ed Mon Sep 17 00:00:00 2001 From: BoYanZh <32470225+BoYanZh@users.noreply.github.com> Date: Sun, 4 Oct 2020 03:27:30 +0800 Subject: update: tidy --- worker/JOJWorker.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'worker/JOJWorker.py') diff --git a/worker/JOJWorker.py b/worker/JOJWorker.py index 1f4fd16..48ea1d2 100644 --- a/worker/JOJWorker.py +++ b/worker/JOJWorker.py @@ -93,11 +93,13 @@ class JOJWorker(): if not os.path.exists(filePath): self.logger.warning(f"{groupName} h{hwNum} {fn} not exist") return 0 + if os.path.exists(filePath + ".zip"): os.remove(filePath + ".zip") with zipfile.ZipFile(filePath + ".zip", mode='w') as zf: zf.write(filePath, fn) res = self.getProblemResult(jojInfo["homeworkID"], problemID, filePath + ".zip", jojInfo["lang"], groupName, fn, hwNum) + os.remove(filePath + ".zip") return res def checkGroupJOJ(self, jojInfo): -- cgit v1.2.3