]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-118702: Implement vectorcall for BaseException (#118703)
authorVictor Stinner <vstinner@python.org>
Fri, 10 May 2024 19:08:24 +0000 (21:08 +0200)
committerGitHub <noreply@github.com>
Fri, 10 May 2024 19:08:24 +0000 (21:08 +0200)
commitaa36f83c1670f1e41fa9432a20e5c4a88ee9012c
tree2dfa668791a82aa1e7725c75e74ed1baa09ae8fa
parentec9d12be9648ee60a2eb02d67069d74f8b314df9
gh-118702: Implement vectorcall for BaseException (#118703)

* BaseException_vectorcall() now creates a tuple from 'args' array.
* Creation an exception using BaseException_vectorcall() is now a
  single function call, rather than having to call
  BaseException_new() and then BaseException_init().
  Calling BaseException_init() is inefficient since it overrides
  the 'args' attribute.
* _PyErr_SetKeyError() now uses PyObject_CallOneArg() to create the
  KeyError instance to use BaseException_vectorcall().
Lib/test/test_exceptions.py
Objects/exceptions.c
Python/errors.c