guydav commited on
Commit
29f937e
1 Parent(s): 6b34a48

Allowed reporting both result and test success

Browse files
Files changed (1) hide show
  1. restrictedpython_code_eval.py +3 -4
restrictedpython_code_eval.py CHANGED
@@ -448,13 +448,12 @@ def _check_correctness(check_program, timeout, task_id, completion_id,
448
  if p.is_alive():
449
  p.kill()
450
 
451
-
452
  if not result:
453
  result.append("Result evaluates to False (probably timed out)")
454
 
455
  out_dict = dict(
456
  task_id=task_id,
457
- passed=result[0] == "passed",
458
  result=result[0],
459
  completion_id=completion_id,
460
  )
@@ -616,8 +615,8 @@ def _unsafe_execute(check_program, result, timeout,
616
 
617
  if return_output:
618
  result.append(additional_locals[output_variable])
619
- else:
620
- result.append("passed")
621
 
622
  except EOFError:
623
  result.append("EOF error")
 
448
  if p.is_alive():
449
  p.kill()
450
 
 
451
  if not result:
452
  result.append("Result evaluates to False (probably timed out)")
453
 
454
  out_dict = dict(
455
  task_id=task_id,
456
+ passed=result[-1] == "passed",
457
  result=result[0],
458
  completion_id=completion_id,
459
  )
 
615
 
616
  if return_output:
617
  result.append(additional_locals[output_variable])
618
+
619
+ result.append("passed")
620
 
621
  except EOFError:
622
  result.append("EOF error")