File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 2626import sys , os
2727from typing import Union , Dict
2828import importlib
29+ import importlib .util
2930from importlib import machinery
3031import inspect
3132import functools
3233
3334from . import pythonmonkey as pm
35+ node_modules = os .path .abspath (
36+ os .path .join (
37+ importlib .util .find_spec ("pminit" ).submodule_search_locations [0 ],
38+ ".." ,
39+ "pythonmonkey" ,
40+ "node_modules"
41+ )
42+ )
3443
3544# Add some python functions to the global python object for code in this file to use.
3645globalThis = pm .eval ("globalThis;" );
@@ -183,7 +192,7 @@ def existsSync(filename: str) -> bool:
183192# require and exports symbols injected from the bootstrap object above. Current PythonMonkey bugs
184193# prevent us from injecting names properly so they are stolen from trail left behind in the global
185194# scope until that can be fixed.
186- with open (os . path . dirname ( __file__ ) + "/node_modules /ctx-module/ctx-module.js" , "r" ) as ctxModuleSource :
195+ with open (node_modules + "/ctx-module/ctx-module.js" , "r" ) as ctxModuleSource :
187196 initCtxModule = pm .eval ("""'use strict';
188197(function moduleWrapper_forCtxModule(broken_require, broken_exports)
189198{
You can’t perform that action at this time.
0 commit comments