File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 11# Export public PythonMonkey APIs
22from .pythonmonkey import *
3- from .require import *
43from .helpers import *
4+ from .require import *
55
66# Expose the package version
77import importlib .metadata
Original file line number Diff line number Diff line change @@ -42,16 +42,17 @@ def new(ctor):
4242# List which symbols are exposed to the pythonmonkey module.
4343__all__ = [ "new" , "typeof" ]
4444
45- # Add the properties of globalThis (except eval) as exports:
45+ # Add the non-enumerable properties of globalThis which don't collide with pythonmonkey.so as exports:
4646globalThis = pm .eval ('globalThis' );
47+ pmGlobals = vars (pm )
4748
4849exports = pm .eval ("""
4950Object.getOwnPropertyNames(globalThis)
50- .filter(prop => prop !== 'eval')
51- .filter(prop => prop[0] !== '_')
52- """ )
51+ .filter(prop => Object.keys(globalThis).indexOf(prop) === -1);
52+ """ , evalOpts )
5353
5454for index in range (0 , int (exports .length )):
5555 name = exports [index ]
56- globals ().update ({name : globalThis [name ]})
57- __all__ .append (name )
56+ if (pmGlobals .get (name ) == None ):
57+ globals ().update ({name : globalThis [name ]})
58+ __all__ .append (name )
You can’t perform that action at this time.
0 commit comments