summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-10-18 16:33:13 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-10-18 16:33:13 (GMT)
commit673cd824ba009ecbb0723192867c27c8e27c0037 (patch)
tree1f521c95e854090065da12ceb9e1925e3911a52d /Lib/test/test_descr.py
parent9def6a3a77569214b49d1b54ef138b0e4985a6bd (diff)
downloadcpython-673cd824ba009ecbb0723192867c27c8e27c0037.zip
cpython-673cd824ba009ecbb0723192867c27c8e27c0037.tar.gz
cpython-673cd824ba009ecbb0723192867c27c8e27c0037.tar.bz2
Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman
Don't crash when getting value of a property raises an exception
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index c9bd1cd..7573bfd 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1814,6 +1814,18 @@ def properties():
raise TestFailed("expected TypeError from trying to set "
"readonly %r attr on a property" % attr)
+ class D(object):
+ __getitem__ = property(lambda s: 1/0)
+
+ d = D()
+ try:
+ for i in d:
+ str(i)
+ except ZeroDivisionError:
+ pass
+ else:
+ raise TestFailed, "expected ZeroDivisionError from bad property"
+
def supers():
if verbose: print "Testing super..."