[Python-checkins] python/dist/src/Lib/test test_class.py,1.7,1.7.6.1

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
2002年6月13日 14:36:37 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv9305/Lib/test
Modified Files:
 Tag: release22-maint
	test_class.py 
Log Message:
Backport:
Fix for SF bug 532646. This is a little simpler than what Neal
suggested there, based upon a better analysis (__getattr__ is a red
herring).
[This might be a 2.1 bugfix candidate we well, if people care]
Index: test_class.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_class.py,v
retrieving revision 1.7
retrieving revision 1.7.6.1
diff -C2 -d -r1.7 -r1.7.6.1
*** test_class.py	11 Dec 2001 19:28:47 -0000	1.7
--- test_class.py	13 Jun 2002 21:36:35 -0000	1.7.6.1
***************
*** 275,276 ****
--- 275,290 ----
 except TypeError: pass
 else: raise TestFailed, "hash(C2()) should raise an exception"
+ 
+ 
+ # Test for SF bug 532646
+ 
+ class A:
+ pass
+ A.__call__ = A()
+ a = A()
+ try:
+ a() # This should not segfault
+ except RuntimeError:
+ pass
+ else:
+ raise TestFailed, "how could this not have overflowed the stack?"

AltStyle によって変換されたページ (->オリジナル) /