File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 8484globalThis .python .stderr .read = lambda n : sys .stderr .read (n )
8585# Python 3.13 dramatically changed how the namespace in `exec`/`eval` works
8686# See https://docs.python.org/3.13/whatsnew/3.13.html#defined-mutation-semantics-for-locals
87- _locals = {} # keep the local variables inside `eval`/`exec` to a dict
88- globalThis .python .eval = lambda x : eval (x , None , _locals )
89- globalThis .python .exec = lambda x : exec (x , None , _locals )
90- globalThis .python .getenv = os .getenv
87+ globalThis .python .eval = lambda x : eval (x , None , sys ._getframe (1 ).f_locals )
88+ globalThis .python .exec = lambda x : exec (x , None , sys ._getframe (1 ).f_locals )
9189globalThis .python .paths = sys .path
9290
9391globalThis .python .exit = pm .eval ("""'use strict';
You can’t perform that action at this time.
0 commit comments