Skip to content

Commit b8a5a61

Browse files
authored
Make simpleRunPython include context in the error it throws (#5503)
1 parent f239f2d commit b8a5a61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pyodide/internal/util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export function simpleRunPython(
6565
// PyRun_SimpleString will have written a Python traceback to stderr.
6666
console.warn('Command failed:', code);
6767
console.warn(cause);
68-
throw new PythonWorkersInternalError('Failed to run Python code');
68+
throw new PythonWorkersInternalError(
69+
'Failed to run Python code:\n' + code + '\n\nError:\n' + cause
70+
);
6971
}
7072
return cause;
7173
}

0 commit comments

Comments
 (0)