| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -611,7 +611,7 @@ class Base(metaclass=metaclass): | |||
| 611 | 611 | ||
| 612 | 612 | # Class creation from C | |
| 613 | 613 | with warnings_helper.check_warnings( | |
| 614 | - ('.*custom tp_new.*in Python 3.14.*', DeprecationWarning), | ||
| 614 | + ('.* _testcapi.Subclass .* custom tp_new.*in Python 3.14.*', DeprecationWarning), | ||
| 615 | 615 | ): | |
| 616 | 616 | sub = _testcapi.make_type_with_base(Base) | |
| 617 | 617 | self.assertTrue(issubclass(sub, Base)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Improve :exc:`DeprecationWarning` for uses of :c:type:`PyType_Spec` with metaclasses that have custom ``tp_new``. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4264,9 +4264,9 @@ _PyType_FromMetaclass_impl( | |||
| 4264 | 4264 | if (_allow_tp_new) { | |
| 4265 | 4265 | if (PyErr_WarnFormat( | |
| 4266 | 4266 | PyExc_DeprecationWarning, 1, | |
| 4267 | - "Using PyType_Spec with metaclasses that have custom " | ||
| 4268 | - "tp_new is deprecated and will no longer be allowed in " | ||
| 4269 | - "Python 3.14.") < 0) { | ||
| 4267 | + "Type %s uses PyType_Spec with a metaclass that has custom " | ||
| 4268 | + "tp_new. This is deprecated and will no longer be allowed in " | ||
| 4269 | + "Python 3.14.", spec->name) < 0) { | ||
| 4270 | 4270 | goto finally; | |
| 4271 | 4271 | } | |
| 4272 | 4272 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments