[pypy-svn] r12355 - pypy/dist/pypy/module/builtin

pedronis at codespeak.net pedronis at codespeak.net
Mon May 16 15:07:00 CEST 2005


Author: pedronis
Date: Mon May 16 15:07:00 2005
New Revision: 12355

Modified:
   pypy/dist/pypy/module/builtin/app_descriptor.py
Log:
classmethod should check that their arg is callable (test_descr checks for this)



Modified: pypy/dist/pypy/module/builtin/app_descriptor.py
==============================================================================
--- pypy/dist/pypy/module/builtin/app_descriptor.py	(original)
+++ pypy/dist/pypy/module/builtin/app_descriptor.py	Mon May 16 15:07:00 2005
@@ -22,6 +22,8 @@
     __slots__ = ['_f']
 
     def __init__(self, f):
+        if not callable(f):
+            raise TypeError, "'%s' object is not callable" % type(f).__name__
         self._f = f
 
     def __get__(self, obj, klass=None):



More information about the Pypy-commit mailing list