summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-06-12 16:24:21 (GMT)
committerGitHub <noreply@github.com>2023-06-12 16:24:21 (GMT)
commit2eed1f5868b1c54a5314b64c38010258d27658da (patch)
tree7b85f4a2893518bf280c6df8aaea366d7ecdf2d3 /Objects
parent9e3e5d533efe154d0df15b2f666fcf88a936d745 (diff)
downloadcpython-2eed1f5868b1c54a5314b64c38010258d27658da.zip
cpython-2eed1f5868b1c54a5314b64c38010258d27658da.tar.gz
cpython-2eed1f5868b1c54a5314b64c38010258d27658da.tar.bz2
[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 2b90796be6959d5ef46b38c434a514fce25be971) Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index b6771d3..bf33bde 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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,