Author: Ronan Lamy <ronan.l...@gmail.com> Branch: py3.5 Changeset: r89031:0c79e8c786b3 Date: 2016-12-12 17:23 +0000 http://bitbucket.org/pypy/pypy/changeset/0c79e8c786b3/
Log: pfff, there are 2 cases here with the same error message but different exception types diff --git a/pypy/module/cpyext/structmember.py b/pypy/module/cpyext/structmember.py --- a/pypy/module/cpyext/structmember.py +++ b/pypy/module/cpyext/structmember.py @@ -91,9 +91,10 @@ member_type = rffi.cast(lltype.Signed, w_member.c_type) flags = rffi.cast(lltype.Signed, w_member.c_flags) - if (flags & READONLY or - member_type in [T_STRING, T_STRING_INPLACE]): + if flags & READONLY: raise oefmt(space.w_AttributeError, "readonly attribute") + elif member_type in [T_STRING, T_STRING_INPLACE]: + raise oefmt(space.w_TypeError, "readonly attribute") elif w_value is None: if member_type == T_OBJECT_EX: if not rffi.cast(PyObjectP, addr)[0]: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit