[Python-checkins] python/dist/src/Lib/test test_descr.py,1.113.4.25,1.113.4.26

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Fri, 18 Oct 2002 09:45:41 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv23022/Lib/test

Modified Files:
      Tag: release22-maint
	test_descr.py 
Log Message:
Backport:
Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman

Don't crash when getting value of a property raises an exception


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.113.4.25
retrieving revision 1.113.4.26
diff -C2 -d -r1.113.4.25 -r1.113.4.26
*** test_descr.py	7 Oct 2002 18:08:26 -0000	1.113.4.25
--- test_descr.py	18 Oct 2002 16:45:39 -0000	1.113.4.26
***************
*** 1684,1687 ****
--- 1684,1699 ----
                               "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..."