mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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
1 changed files with 1 additions and 2 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue