]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)
authorVictor Stinner <vstinner@python.org>
Tue, 5 May 2020 15:07:41 +0000 (17:07 +0200)
committerGitHub <noreply@github.com>
Tue, 5 May 2020 15:07:41 +0000 (17:07 +0200)
commitb0be6b3b94fbdf31b796adc19dc86a04a52b03e1
tree72efb7493602da4318a06510379ceeaae5076bcd
parent4e30ed3af06ae655f4cb8aad8cba21f341384250
bpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)

_PyErr_ChainExceptions() now ensures that the first parameter is an
exception type, as done by _PyErr_SetObject().

* The following function now check PyExceptionInstance_Check() in an
  assertion using a new _PyBaseExceptionObject_cast() helper
  function:

  * PyException_GetTraceback(), PyException_SetTraceback()
  * PyException_GetCause(), PyException_SetCause()
  * PyException_GetContext(), PyException_SetContext()

* PyExceptionClass_Name() now checks PyExceptionClass_Check() with an
  assertion.

* Remove XXX comment and add gi_exc_state variable to _gen_throw().

* Remove comment from test_generators
Lib/test/test_generators.py
Objects/exceptions.c
Objects/genobject.c
Python/errors.c