()
| 184 | ` |
| 185 | |
| 186 | const run = async () => { |
| 187 | try { |
| 188 | // Set up environment variables. |
| 189 | // This is a bit hacky but pyodide's API doesn't give us access to environment variables. |
| 190 | const globals = pyodide.toPy({ envVars: pyodide.toPy(envVars) }) |
| 191 | await pyodide.runPython(EnvVarCode, { |
| 192 | globals: globals, |
| 193 | }) |
| 194 | |
| 195 | await pyodide.runPython(executorCode) |
| 196 | } catch (err) { |
| 197 | sendMessage({ |
| 198 | type: 'stderr', |
| 199 | stderr: err.toString(), |
| 200 | }) |
| 201 | } |
| 202 | sendMessage({ |
| 203 | type: 'finished', |
| 204 | }) |
| 205 | } |
| 206 | |
| 207 | const generateTextContent = async (returnToEditor: boolean) => { |
| 208 | try { |
no test coverage detected