Skip to content

Commit ba1342c

Browse files
authored
gh-87980: Fix the error message for disallowed __weakref__ slots (#25362)
Fix the error message for disallowed `__weakref__` slots.
1 parent 1aab269 commit ba1342c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Objects/typeobject.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -2712,8 +2712,7 @@ type_new_visit_slots(type_new_ctx *ctx)
27122712
if (!ctx->may_add_weak || ctx->add_weak != 0) {
27132713
PyErr_SetString(PyExc_TypeError,
27142714
"__weakref__ slot disallowed: "
2715-
"either we already got one, "
2716-
"or __itemsize__ != 0");
2715+
"we already got one");
27172716
return -1;
27182717
}
27192718
ctx->add_weak++;

0 commit comments

Comments
 (0)