[pypy-svn] pypy jitypes2: remove unused parameter

antocuni commits-noreply at bitbucket.org
Tue Jan 25 16:38:35 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r41301:993b3777cb55
Date: 2011-01-25 16:26 +0100
http://bitbucket.org/pypy/pypy/changeset/993b3777cb55/

Log:	remove unused parameter

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
@@ -317,7 +317,7 @@
             raise
 
     @staticmethod
-    def _conv_param(argtype, arg, index):
+    def _conv_param(argtype, arg):
         if argtype is not None:
             arg = argtype.from_param(arg)
         if hasattr(arg, '_as_parameter_'):
@@ -373,7 +373,7 @@
                     val = defaultvalue
                     if val is None:
                         val = 0
-                    wrapped = self._conv_param(argtype, val, consumed)
+                    wrapped = self._conv_param(argtype, val)
                     wrapped_args.append(wrapped)
                     continue
                 else:
@@ -388,7 +388,7 @@
                 raise TypeError("Not enough arguments")
 
             try:
-                wrapped = self._conv_param(argtype, arg, consumed)
+                wrapped = self._conv_param(argtype, arg)
             except (UnicodeError, TypeError, ValueError), e:
                 raise ArgumentError(str(e))
             wrapped_args.append(wrapped)
@@ -399,7 +399,7 @@
             argtypes = list(argtypes)
             for i, arg in enumerate(extra):
                 try:
-                    wrapped = self._conv_param(None, arg, i)
+                    wrapped = self._conv_param(None, arg)
                 except (UnicodeError, TypeError, ValueError), e:
                     raise ArgumentError(str(e))
                 wrapped_args.append(wrapped)
@@ -572,7 +572,7 @@
             """
             assert self._paramflags is None
             try:
-                wrapped_args = [self._conv_param(argtypes[0], args[0], 0)]
+                wrapped_args = [self._conv_param(argtypes[0], args[0])]
             except (UnicodeError, TypeError, ValueError), e:
                 raise ArgumentError(str(e))
             assert len(wrapped_args) == len(args)

diff --git a/pypy/module/test_lib_pypy/ctypes_tests/test_guess_argtypes.py b/pypy/module/test_lib_pypy/ctypes_tests/test_guess_argtypes.py
--- a/pypy/module/test_lib_pypy/ctypes_tests/test_guess_argtypes.py
+++ b/pypy/module/test_lib_pypy/ctypes_tests/test_guess_argtypes.py
@@ -12,7 +12,7 @@
     from _ctypes.function import CFuncPtr
 
     def guess(value):
-        cobj = CFuncPtr._conv_param(None, value, 0)
+        cobj = CFuncPtr._conv_param(None, value)
         return type(cobj)
 
     assert guess(13) == c_int


More information about the Pypy-commit mailing list