summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-06-18 01:13:41 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-06-18 01:13:41 (GMT)
commitbe9715398b87df269d0781a7c436e10cfa4a0ea4 (patch)
tree21609b835a4f88dddbceb78205b26b20cfb5f8e6 /Lib/test/test_descr.py
parent9b1587836992c460d213b9bbc6f539516139bdf2 (diff)
downloadcpython-be9715398b87df269d0781a7c436e10cfa4a0ea4.zip
cpython-be9715398b87df269d0781a7c436e10cfa4a0ea4.tar.gz
cpython-be9715398b87df269d0781a7c436e10cfa4a0ea4.tar.bz2
SF bug #753451: classmethod abuse --> SystemError
Check the argument to classmethod for callability. Backport candidate.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 9587596..46e3c48 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1485,6 +1485,14 @@ def classmethods():
vereq(super(D,D).goo(), (D,))
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..."
import xxsubtype as spam