[pypy-svn] r26166 - pypy/dist/pypy/rpython/rctypes/test
ericvrp at codespeak.net
ericvrp at codespeak.net
Sun Apr 23 08:53:21 CEST 2006
Author: ericvrp
Date: Sun Apr 23 08:53:18 2006
New Revision: 26166
Modified:
pypy/dist/pypy/rpython/rctypes/test/test_rfunc.py
Log:
(sanxiyn, dialtone, arre, ericvrp)
Updated rctypes tests to ctypes 0.9.9.6
(LoadLibary was deprecated but then resurrected in 0.9.9.6)
Modified: pypy/dist/pypy/rpython/rctypes/test/test_rfunc.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/test/test_rfunc.py (original)
+++ pypy/dist/pypy/rpython/rctypes/test/test_rfunc.py Sun Apr 23 08:53:18 2006
@@ -14,25 +14,16 @@
from ctypes import cdll, pythonapi, _FUNCFLAG_PYTHONAPI
from ctypes import c_int, c_long, c_char_p, c_char, create_string_buffer
-from ctypes import POINTER, py_object
+from ctypes import POINTER, py_object, util
# __________ the standard C library __________
-# LoadLibrary is deprecated in ctypes, this should be removed at some point
-if "load" in dir(cdll):
- cdll_load = cdll.load
-else:
- cdll_load = cdll.LoadLibrary
-
if sys.platform == 'win32':
- mylib = cdll_load('msvcrt.dll')
-elif sys.platform == 'linux2':
- mylib = cdll_load('libc.so.6')
-elif sys.platform == 'darwin':
- mylib = cdll.c
+ mylib = cdll.LoadLibrary('msvcrt.dll')
else:
- py.test.skip("don't know how to load the c lib for %s" %
- sys.platform)
+ clib = util.find_library('c')
+ mylib = cdll.LoadLibrary(clib)
+
# ____________________________________________
labs = mylib.labs
More information about the Pypy-commit
mailing list