Skip to content

lupa does not print Python error when using coroutines #144

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

Open
JakobDev opened this issue Jul 17, 2020 · 0 comments · May be fixed by #145
Open

lupa does not print Python error when using coroutines #144

JakobDev opened this issue Jul 17, 2020 · 0 comments · May be fixed by #145

Comments

@JakobDev
Copy link

If you use coroutines, lupa will not show a Python error. Here a code to reproduce:

from lupa import LuaRuntime

def test():
    int("Hello")

lua = LuaRuntime()
func = lua.eval("function(test) test() end") 
co = func.coroutine(test)
co.send(None)

This produces the following traceback:

Traceback (most recent call last):
  File "./show_error.py", line 10, in <module>
    co.send(None)
  File "lupa/_lupa.pyx", line 876, in lupa._lupa._LuaThread.send
  File "lupa/_lupa.pyx", line 941, in lupa._lupa.resume_lua_thread
  File "lupa/_lupa.pyx", line 1268, in lupa._lupa.raise_lua_error
lupa._lupa.LuaError

As you can see, the Python error (ValueError: invalid literal for int() with base 10: 'Hello') is not shown in the traceback. This makes larger code really hard to debug.

@noahcgreen noahcgreen linked a pull request Aug 7, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant