Ver Fonte

debug if file exists

blumonilr há 5 anos atrás
pai
commit
b0de2b5e7e
1 ficheiros alterados com 2 adições e 1 exclusões
  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]})
             rst_list.append({'result': RESULT_STR[8]})
             return {'result_list': rst_list,
             return {'result_list': rst_list,
                     'message': 'test data:%d incompleted' % i}
                     '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}
     return {'result_list': rst_list}