]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-87980: Fix the error message for disallowed __weakref__ slots (#25362)
authorGéry Ogam <gery.ogam@gmail.com>
Sun, 1 Jan 2023 15:41:33 +0000 (16:41 +0100)
committerGitHub <noreply@github.com>
Sun, 1 Jan 2023 15:41:33 +0000 (21:11 +0530)
Fix the error message for disallowed `__weakref__` slots.

Objects/typeobject.c

index 16b1a3035d56f141a38237b1dc7a050100344d99..43633f044751cabd33d074ce1b2bcd8b03fe9de3 100644 (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++;