diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2023-08-10 15:55:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 15:55:47 (GMT) |
commit | 16dcce21768ba381996a88ac8c255bf1490b3680 (patch) | |
tree | b3a2fb78427046927e4180f2b21c81d2b2b29301 /Objects | |
parent | e4275f4df36a7cdd58cd4daa7d65b1947a2593d3 (diff) | |
download | cpython-16dcce21768ba381996a88ac8c255bf1490b3680.zip cpython-16dcce21768ba381996a88ac8c255bf1490b3680.tar.gz cpython-16dcce21768ba381996a88ac8c255bf1490b3680.tar.bz2 |
gh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 71e96f5..aca14e7 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4264,9 +4264,9 @@ _PyType_FromMetaclass_impl( if (_allow_tp_new) { if (PyErr_WarnFormat( PyExc_DeprecationWarning, 1, - "Using PyType_Spec with metaclasses that have custom " - "tp_new is deprecated and will no longer be allowed in " - "Python 3.14.") < 0) { + "Type %s uses PyType_Spec with a metaclass that has custom " + "tp_new. This is deprecated and will no longer be allowed in " + "Python 3.14.", spec->name) < 0) { goto finally; } } |