mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
This commit is contained in:
parent
58f0bda341
commit
2b90796be6
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