[Python-checkins] python/dist/src/Lib/test test_descr.py,1.194,1.195

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Tue, 17 Jun 2003 18:13:44 -0700


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

Modified Files:
	test_descr.py 
Log Message:
SF bug #753451: classmethod abuse --> SystemError

Check the argument to classmethod for callability.

Backport candidate.



Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.194
retrieving revision 1.195
diff -C2 -d -r1.194 -r1.195
*** test_descr.py	16 Jun 2003 22:51:22 -0000	1.194
--- test_descr.py	18 Jun 2003 01:13:41 -0000	1.195
***************
*** 1486,1489 ****
--- 1486,1497 ----
      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 classmethods_in_c():
      if verbose: print "Testing C-based class methods..."