[pypy-svn] r13133 - pypy/dist/pypy/rpython

pedronis at codespeak.net pedronis at codespeak.net
Tue Jun 7 02:00:46 CEST 2005


Author: pedronis
Date: Tue Jun  7 02:00:45 2005
New Revision: 13133

Modified:
   pypy/dist/pypy/rpython/lltype.py
Log:
move responsability for checking _func._callable



Modified: pypy/dist/pypy/rpython/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltype.py	(original)
+++ pypy/dist/pypy/rpython/lltype.py	Tue Jun  7 02:00:45 2005
@@ -475,7 +475,10 @@
             for a, ARG in zip(args, self._T.ARGS):
                 if typeOf(a) != ARG:
                     raise TypeError,"calling %r with wrong argument types: %r" % (self._T, args)
-            return self._obj._callable(*args)
+            callb = self._obj._callable
+            if callb is None:
+                raise RuntimeError,"calling undefined function"
+            return callb(*args)
         raise TypeError("%r instance is not a function" % (self._T,))
             
 
@@ -588,8 +591,7 @@
         return None
 
     def _check(self):
-        if self._callable is None:
-            raise RuntimeError,"calling undefined function"
+        pass
 
     def __repr__(self):
         return '<%s>' % (self,)



More information about the Pypy-commit mailing list