Explorar o código

debug if file exists

blumonilr %!s(int64=5) %!d(string=hai) anos
pai
achega
b0de2b5e7e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      web/judgement.py

+ 2 - 1
web/judgement.py

@@ -105,5 +105,6 @@ def judge(src_path, td_path, td_total, time_limit, memory_limit, language):
             rst_list.append({'result': RESULT_STR[8]})
             return {'result_list': rst_list,
                     'message': 'test data:%d incompleted' % i}
-    os.remove(src_file)
+    if os.path.exists(src_file):
+        os.remove(src_file)
     return {'result_list': rst_list}