fix(sandbox): treat non-zero exit codes as errors instead of relying only on stderr

This commit is contained in:
Eternity
2026-01-26 18:50:22 +08:00
parent f1f887faae
commit 1f615a06ad
3 changed files with 4 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ async def run_python_code(code: str, preload: str, options: RunnerOptions):
if result.exit_code == -signal.SIGSYS:
return error_response(31, "sandbox security policy violation")
if result.stderr:
if result.stderr and result.exit_code != 0:
return error_response(500, result.stderr)
return success_response(RunCodeResponse(