diff options
author | Géry Ogam <gery.ogam@gmail.com> | 2023-01-01 15:41:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-01 15:41:33 (GMT) |
commit | ba1342ce998c6c0c36078411d169f29179fbc9f6 (patch) | |
tree | 93d0ea3a1c337083bc48b2c439cdc353e7bbbcdb | |
parent | 1aab269d4acbf0b29573ad0a21c54fddee233243 (diff) | |
download | cpython-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.c | 3 |
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++; |