gh-87980: Fix the error message for disallowed __weakref__ slots (#25362)

Fix the error message for disallowed `__weakref__` slots.
This commit is contained in:
Géry Ogam 2023-01-01 16:41:33 +01:00 committed by GitHub
parent 1aab269d4a
commit ba1342ce99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -2712,8 +2712,7 @@ type_new_visit_slots(type_new_ctx *ctx)
if (!ctx->may_add_weak || ctx->add_weak != 0) {
PyErr_SetString(PyExc_TypeError,
"__weakref__ slot disallowed: "
"either we already got one, "
"or __itemsize__ != 0");
"we already got one");
return -1;
}
ctx->add_weak++;