-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Throwing exceptions across modules causes namespace issues #290
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
Comments
That's because objfun.c:
If exception occurs in func body execution, nothing restores old globals. And apparently it makes no sense to add unwind-protect to fun_bc_call(), because mp_execute_byte_code() soon will do another nlr_push. So, apparently mp_execute_byte_code() should be passed a namespace and should take care of saving/restoring current one. |
No working on this further so far, assuming @dpgeorge will have better idea where/how to implement this. |
Also, consider generator impl at the same time - objgenerator doesn't have any calls to rt_globals_set() at all. |
…odule. Issue #290. This currently fails, to draw attention to the issue.
Ok, so I'm eager to get my piece working ;-). I pushed a testcase for this to testsuite (so it's broken now), and submitted #292 as proposed fix. |
Addresses issue #290, and hopefully sets up things to allow generators throwing exceptions, etc.
This was fixed. |
Testcase:
The text was updated successfully, but these errors were encountered: