diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/structmember.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/structmember.c b/Python/structmember.c index 88ea6f8..0ebd189 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -106,7 +106,7 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) addr += l->offset; - if ((l->flags & READONLY) || l->type == T_STRING) + if ((l->flags & READONLY)) { PyErr_SetString(PyExc_AttributeError, "readonly attribute"); return -1; @@ -266,6 +266,10 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) *(char*)addr = string[0]; break; } + case T_STRING: + case T_STRING_INPLACE: + PyErr_SetString(PyExc_TypeError, "readonly attribute"); + return -1; #ifdef HAVE_LONG_LONG case T_LONGLONG:{ PY_LONG_LONG value; |