You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#4400
As the return value is ultimately communicated back via a StopIteration
exception instance, a peculiar behavior of `PyErr::new` is encountered
here: when the argument is a tuple `arg`, it is used to construct the
exception as if calling from Python `Exception(*arg)` and not
`Exception(arg)` like for every other type of argument.
This comes from from CPython's `PyErr_SetObject` which ultimately calls
`_PyErr_CreateException` where the "culprit" is found here:
https://github.com/python/cpython/blob/main/Python/errors.c#L33
We can fix this particular bug in the invocation of `PyErr::new` but it
is a more general question if we want to keep reflecting this somewhat
surprising CPython behavior, or create a better API, introducing a
breaking change.
0 commit comments