mirror of https://github.com/python/cpython
gh-87980: Fix the error message for disallowed __weakref__ slots (#25362)
Fix the error message for disallowed `__weakref__` slots.
This commit is contained in:
parent
1aab269d4a
commit
ba1342ce99
|
@ -2712,8 +2712,7 @@ type_new_visit_slots(type_new_ctx *ctx)
|
||||||
if (!ctx->may_add_weak || ctx->add_weak != 0) {
|
if (!ctx->may_add_weak || ctx->add_weak != 0) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
"__weakref__ slot disallowed: "
|
"__weakref__ slot disallowed: "
|
||||||
"either we already got one, "
|
"we already got one");
|
||||||
"or __itemsize__ != 0");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ctx->add_weak++;
|
ctx->add_weak++;
|
||||||
|
|
Loading…
Reference in New Issue