Author: Matti Picus <[email protected]>
Branch:
Changeset: r69807:032d052a1a9f
Date: 2014-03-08 21:45 +0200
http://bitbucket.org/pypy/pypy/changeset/032d052a1a9f/
Log: win32 cleanup
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
@@ -322,23 +322,24 @@
# 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)
diff --git a/pypy/module/test_lib_pypy/cffi_tests/test_function.py
b/pypy/module/test_lib_pypy/cffi_tests/test_function.py
--- a/pypy/module/test_lib_pypy/cffi_tests/test_function.py
+++ b/pypy/module/test_lib_pypy/cffi_tests/test_function.py
@@ -36,11 +36,13 @@
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
@@ -55,6 +57,8 @@
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);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit