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 unhandled exception in set_caster #772

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Conversation

tjstum
Copy link
Contributor

@tjstum tjstum commented Oct 31, 2024

obj_iter throws python_error on failure, but type casters aren't allowed to throw! If you try to from-Python cast an object of a non-iterable type, Python will abort from the unhandled exception coming from a noexcept function

It looks like the intention here is to handle failure manually (a NULL return from the CPython call), so I did just that

`obj_iter` throws `python_error` on failure, but type casters aren't
allowed to throw! If you try to from-Python cast an object of a
non-iterable type, Python will abort from the unhandled exception
coming from a `noexcept` function

It looks like the intention here is to handle failure manually (a NULL
return from the CPython call), so I did just that
@wjakob
Copy link
Owner

wjakob commented Nov 3, 2024

Thanks!

@wjakob wjakob merged commit 977cd37 into wjakob:master Nov 3, 2024
31 checks passed
@tjstum tjstum deleted the set_caster branch November 3, 2024 19:52
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