[issue33576] Remove exception wrapping from __set_name__ calls

Nick Coghlan report at bugs.python.org
Sat May 19 08:40:14 EDT 2018


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Hmm, I wonder if the UX problem with the current chaining might be solved in a different way, by doing something similar to what we did for codec exceptions (where we want to try to mention the codec name, but also don't want to change the exception type, and want to include the original exception text in the wrapper's message).

The codecs related call is at https://github.com/python/cpython/blob/0c1c4563a65ac451021d927058e4f25013934eb2/Python/codecs.c#L389 but most of the heavy lifting has since been refactored out into the _PyErr_TrySetFromCause helper function: https://github.com/python/cpython/blob/55edd0c185ad2d895b5d73e47d67049bc156b654/Objects/exceptions.c#L2713

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33576>
_______________________________________


More information about the Python-bugs-list mailing list