Skip to content
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

Clear Python pending hook exception before we enter the emulation. #1537

Conversation

gerph
Copy link
Contributor

@gerph gerph commented Jan 15, 2022

The pending exception hook is set when the hook raised an exception
and wants to report it outside the emulation loop. However, it is
never cleared back to None. This means that after an exception is
raised in a hook, all subsequent execution (even if successful) will
raise the exception.

This change clears the exception before we start another emulation,
which should ensure that if we have _hook_exception set, it really
is from hooks in this emulation run.

The pending exception hook is set when the hook raised an exception
and wants to report it outside the emulation loop. However, it is
never cleared back to None. This means that after an exception is
raised in a hook, all subsequent execution (even if successful) will
raise the exception.

This change clears the exception before we start another emulation,
which should ensure that if we have _hook_exception set, it really
is from hooks in this emulation run.
@wtdcode
Copy link
Member

wtdcode commented Jan 15, 2022

Merged, thanks!

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 this pull request may close these issues.

2 participants