summaryrefslogtreecommitdiffstats
path: root/Python/structmember.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-04-03 01:40:24 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-04-03 01:40:24 (GMT)
commit80d8fd85a932ad6ec66922f41078965bd94bf645 (patch)
tree46337d278e20eb5cd5024b0153ce667fd1aa64e9 /Python/structmember.c
parenta811c16a261b9ec1718960d6acc90fad55e612af (diff)
downloadcpython-80d8fd85a932ad6ec66922f41078965bd94bf645.zip
cpython-80d8fd85a932ad6ec66922f41078965bd94bf645.tar.gz
cpython-80d8fd85a932ad6ec66922f41078965bd94bf645.tar.bz2
Merged revisions 79642,79644 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79642 | benjamin.peterson | 2010-04-02 20:08:34 -0500 (Fri, 02 Apr 2010) | 1 line split out large test function ........ r79644 | benjamin.peterson | 2010-04-02 20:28:57 -0500 (Fri, 02 Apr 2010) | 1 line give TypeError when trying to set T_STRING_INPLACE ........
Diffstat (limited to 'Python/structmember.c')
-rw-r--r--Python/structmember.c6
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;