summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGéry Ogam <gery.ogam@gmail.com>2023-01-01 15:41:33 (GMT)
committerGitHub <noreply@github.com>2023-01-01 15:41:33 (GMT)
commitba1342ce998c6c0c36078411d169f29179fbc9f6 (patch)
tree93d0ea3a1c337083bc48b2c439cdc353e7bbbcdb
parent1aab269d4acbf0b29573ad0a21c54fddee233243 (diff)
downloadcpython-ba1342ce998c6c0c36078411d169f29179fbc9f6.zip
cpython-ba1342ce998c6c0c36078411d169f29179fbc9f6.tar.gz
cpython-ba1342ce998c6c0c36078411d169f29179fbc9f6.tar.bz2
gh-87980: Fix the error message for disallowed __weakref__ slots (#25362)
Fix the error message for disallowed `__weakref__` slots.
-rw-r--r--Objects/typeobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 16b1a30..43633f0 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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++;