From 6021fff7dd524c383a4afba8abafb45fba84c0b6 Mon Sep 17 00:00:00 2001 From: Eugenio Parodi Date: Thu, 14 Dec 2023 10:57:41 +0000 Subject: [PATCH] Fixed the __file__ in the html5 pyodide launcher --- tests/sandbox/js/ttkproxy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sandbox/js/ttkproxy.js b/tests/sandbox/js/ttkproxy.js index 6eff0038..d805d0f6 100644 --- a/tests/sandbox/js/ttkproxy.js +++ b/tests/sandbox/js/ttkproxy.js @@ -189,10 +189,11 @@ class TTkProxy { this.ttk_clean() console.log("Run App") - let pwd = this.pyodide.PATH.dirname(filename) + let pwd = this.pyodide.PATH.dirname(filename) + let file = this.pyodide.PATH.basename(filename) this.pyodide.runPython(` - __file__='`+filename+`' + __file__='`+file+`' os.chdir('`+pwd+`') ttk.TTkCfg.maxFps = `+fps,{ globals: this.namespace })