From fca9b4ec1ca039b206134b326752aed631fe3c6e Mon Sep 17 00:00:00 2001 From: Catherine Date: Sat, 18 May 2024 18:16:06 +0100 Subject: [PATCH] Add a note about Python loader code. NFC --- src/extension.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extension.ts b/src/extension.ts index 2358634..cab7001 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -445,6 +445,7 @@ function workerEntryPoint(self: WorkerContext) { } else { pyodide = await preparePyodide(args); console.log(`[YoWASP Toolchain] Running Python file '${args[0]}'...`); + // This could be read from `pyodide.FS`, but error handling gets really weird. const pyArgv0 = `__import__("sys").argv[0]`; const pyReadFile = `(lambda f: (f.read(), f.close()))(open(${pyArgv0}))[0]`; const pyLoader = `exec(compile(${pyReadFile}, ${pyArgv0}, 'exec'))`;