summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-04-03 01:46:38 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-04-03 01:46:38 (GMT)
commitbde0c9db80db8abe0489b4f96ff88e06890d8787 (patch)
tree2ab2e16b333f060708e4b93fd9f83a92ac1ad80c /Python
parent05609eff8a6d02753b8a177560998034f28efb5d (diff)
downloadcpython-bde0c9db80db8abe0489b4f96ff88e06890d8787.zip
cpython-bde0c9db80db8abe0489b4f96ff88e06890d8787.tar.gz
cpython-bde0c9db80db8abe0489b4f96ff88e06890d8787.tar.bz2
Merged revisions 79645 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r79645 | benjamin.peterson | 2010-04-02 20:40:24 -0500 (Fri, 02 Apr 2010) | 13 lines 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')
-rw-r--r--Python/structmember.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/structmember.c b/Python/structmember.c
index 8edc354..711cfe5 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;
@@ -265,6 +265,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;