Commits

mattip committed 032d052

win32 cleanup

Comments (0)

Files changed (2)

lib_pypy/_ctypes/function.py

             #              RuntimeWarning, stacklevel=2)
             argtypes = []
 
+        argsl = list(args)
         if self._com_index:
             from ctypes import cast, c_void_p, POINTER
-            if not args:
+            if not argsl:
                 raise ValueError(
                     "native COM method call without 'this' parameter"
                     )
-            thisvalue = args.pop(0)
+            thisvalue = argsl.pop(0)
             thisarg = cast(thisvalue, POINTER(POINTER(c_void_p)))
             keepalives, newargs, argtypes, outargs, errcheckargs = (
-                        self._convert_args(argtypes, args, kwargs))
-            args.insert(0, thisvalue)
+                        self._convert_args(argtypes, argsl, kwargs))
+            argsl.insert(0, thisvalue)
             newargs.insert(0, thisvalue.value)
             argtypes.insert(0, c_void_p)
         else:
             thisarg = None
             keepalives, newargs, argtypes, outargs, errcheckargs = (
-                        self._convert_args(argtypes, args, kwargs))
+                        self._convert_args(argtypes, argsl, kwargs))
 
         funcptr = self._getfuncptr(argtypes, self._restype_, thisarg)
         result = self._call_funcptr(funcptr, *newargs)

pypy/module/test_lib_pypy/cffi_tests/test_function.py

         return self._value
 
 lib_m = 'm'
+has_sinf = True
 if sys.platform == 'win32':
     #there is a small chance this fails on Mingw via environ $CC
     import distutils.ccompiler
     if distutils.ccompiler.get_default_compiler() == 'msvc':
         lib_m = 'msvcrt'
+        has_sinf = False
 
 class TestFunction(object):
     Backend = CTypesBackend
         assert x == math.sin(1.23)
 
     def test_sinf(self):
+        if not has_sinf:
+            py.test.skip("sinf not available")
         ffi = FFI(backend=self.Backend())
         ffi.cdef("""
             float sinf(float x);