[issue23763] Chain exceptions in C

STINNER Victor report at bugs.python.org
Tue Mar 24 15:44:41 CET 2015


STINNER Victor added the comment:

pyerr_assert.patch: modify PyErr_SetObject() and PyErr_Format() to fail with an assertion error if these functions are called with an exception set.

This patch detects where an exception is raised while another exception was already raised (like "try: ... except: raise ...").

I'm using this patch to explicitly not chain exceptions where chaining exceptions would be pointless (ex: replace a TypeError with a new TypeError with a better error message).

----------
keywords: +patch
Added file: http://bugs.python.org/file38666/pyerr_assert.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23763>
_______________________________________


More information about the Python-bugs-list mailing list