[Python-checkins] python/dist/src/Lib/test test_descr.py,1.113.4.34,1.113.4.35

anthonybaxter@users.sourceforge.net anthonybaxter@users.sourceforge.net
Sun, 13 Jul 2003 06:54:36 -0700


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

Modified Files:
      Tag: release22-maint
	test_descr.py 
Log Message:
Backport of rhettinger's funcobject.c 2.63, bugfix for SF bug 753451
Check the argument of classmethod is callable. (prevents 
classmethod(classmethod(func)) from bombing out.


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.113.4.34
retrieving revision 1.113.4.35
diff -C2 -d -r1.113.4.34 -r1.113.4.35
*** test_descr.py	16 Jun 2003 23:38:27 -0000	1.113.4.34
--- test_descr.py	13 Jul 2003 13:54:34 -0000	1.113.4.35
***************
*** 1288,1291 ****
--- 1288,1299 ----
      vereq(super(D,d).goo(), (D,))
  
+     # Verify that argument is checked for callability (SF bug 753451)
+     try:
+         classmethod(1).__get__(1)
+     except TypeError:
+         pass
+     else:
+         raise TestFailed, "classmethod should check for callability"
+ 
  def staticmethods():
      if verbose: print "Testing static methods..."