[pypy-svn] pypy jitypes2: (david, antocuni)

antocuni commits-noreply at bitbucket.org
Thu Jan 20 19:52:15 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r41083:d3e698349af3
Date: 2011-01-20 18:15 +0100
http://bitbucket.org/pypy/pypy/changeset/d3e698349af3/

Log:	(david, antocuni) put asserts wherever there are "ifs" in the
	general code

diff --git a/lib_pypy/_ctypes/function.py b/lib_pypy/_ctypes/function.py
--- a/lib_pypy/_ctypes/function.py
+++ b/lib_pypy/_ctypes/function.py
@@ -545,14 +545,18 @@
                 self.__class__ = CFuncPtr
                 return self(*args)
 
+            assert self.callable is None
+            assert not self._com_index
+            assert self._argtypes_ is not None
             argtypes = self._argtypes_
             thisarg = None
             args = self._convert_args(argtypes, args)
-            argtypes = [type(arg) for arg in args]
+            argtypes = [type(args[0])]
             newargs = self._unwrap_args(argtypes, args)
-
             restype = self._restype_
             funcptr = self._getfuncptr(argtypes, restype, thisarg)
-            return self._call_funcptr(funcptr, *newargs)
+            result = self._call_funcptr(funcptr, *newargs)
+            assert self._errcheck_ is None
+            return result
 
     return CFuncPtr_1


More information about the Pypy-commit mailing list