giulio98 commited on
Commit
9c29da7
1 Parent(s): 53cd26f

Update execute.py

Browse files
Files changed (1) hide show
  1. execute.py +3 -3
execute.py CHANGED
@@ -40,7 +40,7 @@ def check_correctness(check_program, output, timeout, task_id, completion_id):
40
  manager = multiprocessing.Manager()
41
  result = manager.list()
42
 
43
- p = multiprocessing.Process(target=unsafe_execute, args=(check_program, output, result, timeout))
44
  p.start()
45
  p.join(timeout=timeout + 1)
46
  if p.is_alive():
@@ -59,7 +59,7 @@ def check_correctness(check_program, output, timeout, task_id, completion_id):
59
 
60
 
61
 
62
- def unsafe_execute(check_program, output, result, timeout):
63
 
64
  with create_tempdir():
65
 
@@ -84,7 +84,7 @@ def unsafe_execute(check_program, output, result, timeout):
84
  exit_code = p.returncode
85
  if stderrdata != '':
86
  raise BaseException(stderrdata)
87
- if stdoutdata.strip() == output[0].strip():
88
  result.append("passed")
89
  else:
90
  result.append("not passed")
 
40
  manager = multiprocessing.Manager()
41
  result = manager.list()
42
 
43
+ p = multiprocessing.Process(target=unsafe_execute, args=(check_program, output, task_id, result, timeout))
44
  p.start()
45
  p.join(timeout=timeout + 1)
46
  if p.is_alive():
 
59
 
60
 
61
 
62
+ def unsafe_execute(check_program, output, task_id, result, timeout):
63
 
64
  with create_tempdir():
65
 
 
84
  exit_code = p.returncode
85
  if stderrdata != '':
86
  raise BaseException(stderrdata)
87
+ if stdoutdata.strip() == output[task_id].strip():
88
  result.append("passed")
89
  else:
90
  result.append("not passed")