]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44232: Fix type_new() error reporting (GH-26359) (GH-26365)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 26 May 2021 09:30:55 +0000 (02:30 -0700)
committerGitHub <noreply@github.com>
Wed, 26 May 2021 09:30:55 +0000 (11:30 +0200)
commit7b3b6982a5683f5146ede58a448d3edb777e501b
treecdeb80f99a6008afb4a6610e4276d17b108055cf
parent2442b342bcbaf24334be7f70fb695d277c7a9a13
bpo-44232: Fix type_new() error reporting (GH-26359) (GH-26365)

Fix a regression in type() when a metaclass raises an exception. The
C function type_new() must properly report the exception when a
metaclass constructor raises an exception and the winner class is not
the metaclass.
(cherry picked from commit bd199e72fb60a8ff001a023f23925092a290be91)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/test_types.py
Misc/NEWS.d/next/Core and Builtins/2021-05-25-18-20-10.bpo-44232.DMcCCf.rst [new file with mode: 0644]
Objects/typeobject.c