Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r58400:0278546b4427
Date: 2012-10-24 19:18 +0200
http://bitbucket.org/pypy/pypy/changeset/0278546b4427/
Log: catch the correct exception type for both pypy and cpython
diff --git a/pypy/module/__builtin__/test/test_descriptor.py
b/pypy/module/__builtin__/test/test_descriptor.py
--- a/pypy/module/__builtin__/test/test_descriptor.py
+++ b/pypy/module/__builtin__/test/test_descriptor.py
@@ -323,7 +323,9 @@
for attr in "__doc__", "fget", "fset", "fdel":
try:
setattr(raw, attr, 42)
- except AttributeError as msg:
+ # it raises TypeError on pypy, AttributeError on CPython: we catch
+ # both so that it runs also with -A
+ except (TypeError, AttributeError) as msg:
if str(msg).find('readonly') < 0:
raise Exception("when setting readonly attr %r on a "
"property, got unexpected TypeError "
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit