aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/lua_in_python.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lua_in_python.py')
-rw-r--r--tests/lua_in_python.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/lua_in_python.py b/tests/lua_in_python.py
index eec2042..7692e2f 100644
--- a/tests/lua_in_python.py
+++ b/tests/lua_in_python.py
@@ -16,20 +16,22 @@ print(
from lupa import LuaRuntime
lua = LuaRuntime(unpack_returned_tuples=True)
-import asyncio
+import os
-async def get_Dice_Dir():
- import os
- await asyncio.sleep(1)
+def get_Dice_Dir():
return os.path.dirname(os.path.abspath(__file__))
lua.globals().getDiceDir = get_Dice_Dir
-
-print(
- lua.eval(
+lua.globals().package.path = lua.globals().package.path + ';' + os.path.join(get_Dice_Dir(), '?.lua')
+try:
+ lua.execute(
"""\
- getDiceDir()
- """
+ print(getDiceDir())
+ print(package.path)
+ js = require('json')
+ print(js)
+ """
)
-)
+except Exception as e:
+ print(f'{e!r}') \ No newline at end of file