MultiPLE-Evaluator / src /eval_julia.py
dongsheng's picture
Upload 48 files
41e79e2 verified
raw
history blame contribute delete
582 Bytes
from src.safe_subprocess import run
from pathlib import Path
def eval_script(path: Path):
result = run(["julia", str(path)], timeout_seconds=5)
if result.timeout:
status = "Timeout"
elif result.exit_code == 0:
status = "OK"
# TODO(arjun): I would like this to be reviewed more carefully by John.
elif len(result.stderr) < 1:
status = "Exception"
else:
status = "SyntaxError"
return {
"status": status,
"exit_code": result.exit_code,
"stdout": result.stdout,
"stderr": result.stderr,
}