diff options
author | Collin Winter <collinw@gmail.com> | 2007-03-28 21:44:53 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-03-28 21:44:53 (GMT) |
commit | 42dae6a89bd24073ae1b66599180cc94f15ff232 (patch) | |
tree | 7df2ee86dc68b54e0b207eaa6862bfc82272e382 /Lib/test/test_descr.py | |
parent | d84da1b67a12df114de2f76e0644174f07f2c834 (diff) | |
download | cpython-42dae6a89bd24073ae1b66599180cc94f15ff232.zip cpython-42dae6a89bd24073ae1b66599180cc94f15ff232.tar.gz cpython-42dae6a89bd24073ae1b66599180cc94f15ff232.tar.bz2 |
Make readonly members defined in C throw an AttributeError on modification. This brings them into sync with Python-level attributes. Fixes bug #1687163.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 6cd8ccd..eec4e40 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1857,13 +1857,13 @@ def properties(): for attr in "__doc__", "fget", "fset", "fdel": try: setattr(raw, attr, 42) - except TypeError as msg: + except AttributeError as msg: if str(msg).find('readonly') < 0: raise TestFailed("when setting readonly attr %r on a " - "property, got unexpected TypeError " + "property, got unexpected AttributeError " "msg %r" % (attr, str(msg))) else: - raise TestFailed("expected TypeError from trying to set " + raise TestFailed("expected AttributeError from trying to set " "readonly %r attr on a property" % attr) class D(object): |