This commit is contained in:
Phil Szalay 2025-03-13 12:22:19 +01:00
parent 0ab1c2c978
commit b28ef9b837
2 changed files with 2 additions and 2 deletions

View File

@ -62,8 +62,6 @@ const executeCode = async (id: string, code: string) => {
try {
console.log('CODEEE', code);
// Dynamically load required packages based on imports in the Python code
await self.pyodide.loadPackagesFromImports(code, {
messageCallback: (msg: string) => {

View File

@ -71,6 +71,8 @@ self.onmessage = async (event) => {
console.log(event.data);
console.log('CODEEE', code);
// The worker copies the context in its own "memory" (an object mapping name to values)
for (const key of Object.keys(context)) {
self[key] = context[key];