-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Worker support] Kill _unwrapped_remote #1384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I investigated a bit what's needed to kill diff --git a/pyscriptjs/src/main.ts b/pyscriptjs/src/main.ts
index 86eaf9e..e3e8a7f 100644
--- a/pyscriptjs/src/main.ts
+++ b/pyscriptjs/src/main.ts
@@ -415,7 +415,8 @@ export class PyScriptApp {
// interpreter API level and allow each one to implement it in its own way
// eventually replace with interpreter.pyimport(modulename);
- const module = interpreter._unwrapped_remote.pyimport(modulename);
+ //const module = interpreter._unwrapped_remote.pyimport(modulename);
+ const module = await interpreter._remote.pyimport(modulename);
if (typeof (await module.plugin) !== 'undefined') {
const py_plugin = module.plugin as PythonPlugin;
py_plugin.init(this); With
This is the traceback which I see in the console: The traceback is very obscure and I cannot even understand in which part of our code originates from. It seems an internal synclink problem, but I'm not really sure. @hoodmane do you have a clue? |
Yes. It comes from Pyodide's callKwargs. The last argument is supposed to be an argument but instead it's a synclink proxy. I think the easiest fix is to make an extra transfer handler for kwargs objects. Probably add a symbol to mark an object as a kwargs. |
This is a follow-up of #1333 (once it's merged).
We should kill the last remaining usage of
_unwrapped_remote
, because it works only in the main thread case and cannot work in the worker case.AFAIK this is the last place where we use it:
pyscript/pyscriptjs/src/main.ts
Lines 397 to 402 in ef0e838
Killing it should also make it possible to simplify and cleanup some ugly code such as this:
pyscript/pyscriptjs/src/main.ts
Lines 220 to 227 in ef0e838
The text was updated successfully, but these errors were encountered: