Nick Coghlan added the comment: After looking into this further, PyErr_SetObject (and other APIs like PyErr_SetString which call that internally) aim to handle the chaining automatically, but they don't handle exceptions which haven't been normalized yet.
PyErr_SetObject should probably normalise the exception at the start of the call f ithe exception type is set on the thread state, but not the exception value. ---------- title: Convert _PyErr_ChainExceptions to a public API -> Exception chaining should trigger for non-normalised exceptions type: enhancement -> behavior _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23188> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com