mirror of
https://github.com/python/cpython.git
synced 2025-09-24 17:33:29 +00:00
[3.12] gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) (GH-105697)
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
(cherry picked from commit 2b90796be6
)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
9e3e5d533e
commit
2eed1f5868
5 changed files with 53 additions and 9 deletions
|
@ -4236,7 +4236,7 @@ _PyType_FromMetaclass_impl(
|
|||
metaclass);
|
||||
goto finally;
|
||||
}
|
||||
if (metaclass->tp_new != PyType_Type.tp_new) {
|
||||
if (metaclass->tp_new && metaclass->tp_new != PyType_Type.tp_new) {
|
||||
if (_allow_tp_new) {
|
||||
if (PyErr_WarnFormat(
|
||||
PyExc_DeprecationWarning, 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue