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

Fix re-raising of KjException #346

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

LasseBlaauwbroek
Copy link
Contributor

  • The KjException._to_python() function neglected to check if the wrapper was set when attempting to convert to AttributeError, leading to exceptions while raising an exception.
  • The syntax raise A, B, C hasn't existed since Python 3. The only reason it works is because Cython supports it. Lets get rid of it.
  • There was an attempt to convert a certain kind of KjException to an AttributeError. However, the original exception remains in the context when the new exception is raised. This is confusing. We get rid of the original exception by doing raise e._to_python() from None.

- The `KjException._to_python()` function neglected to check if the wrapper was
  set when attempting to convert to `AttributeError`, leading to exceptions while
  raising an exception.
- The syntax `raise A, B, C` hasn't existed since Python 3. The only reason it
  works is because Cython supports it. Lets get rid of it.
- There was an attempt to convert a certain kind of `KjException` to an
  `AttributeError`. However, the original exception remains in the context when
  the new exception is raised. This is confusing. We get rid of the original
  exception by doing `raise e._to_python() from None`.
@haata haata merged commit 49bda5c into capnproto:master Nov 8, 2023
12 checks passed
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