terminate sandboxes
Browse files- utils/code_sandbox.py +1 -0
utils/code_sandbox.py
CHANGED
|
@@ -71,6 +71,7 @@ def code_eval(code_snippet: str) -> tuple[dict, str]:
|
|
| 71 |
proc = sb.exec("python", "/tmp/solution.py")
|
| 72 |
proc.wait()
|
| 73 |
error = proc.returncode != 0
|
|
|
|
| 74 |
|
| 75 |
return {
|
| 76 |
"error": "Script failed with non-zero exit code" if error else "",
|
|
|
|
| 71 |
proc = sb.exec("python", "/tmp/solution.py")
|
| 72 |
proc.wait()
|
| 73 |
error = proc.returncode != 0
|
| 74 |
+
sb.terminate()
|
| 75 |
|
| 76 |
return {
|
| 77 |
"error": "Script failed with non-zero exit code" if error else "",
|