Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.5
Changeset: r89013:db801833173a
Date: 2016-12-12 11:55 +0000
http://bitbucket.org/pypy/pypy/changeset/db801833173a/

Log:    Fix exception type when trying to delete a readonly member

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
@@ -93,7 +93,7 @@
 
     if (flags & READONLY or
         member_type in [T_STRING, T_STRING_INPLACE]):
-        raise oefmt(space.w_TypeError, "readonly attribute")
+        raise oefmt(space.w_AttributeError, "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

Reply via email to