[pypy-svn] r26162 - pypy/dist/pypy/rpython/rctypes/socketmodule

sanxiyn at codespeak.net sanxiyn at codespeak.net
Sun Apr 23 08:00:12 CEST 2006


Author: sanxiyn
Date: Sun Apr 23 08:00:09 2006
New Revision: 26162

Modified:
   pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py
Log:
(sanxiyn, dialtone, arre, ericvrp)
Updated to new ctypes API to find native dynamic library


Modified: pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py	Sun Apr 23 08:00:09 2006
@@ -1,5 +1,6 @@
 import os
 from pypy.rpython.rctypes.tool import ctypes_platform
+import ctypes.util
 from ctypes import *
 
 includes = ('sys/types.h',
@@ -52,7 +53,8 @@
 SetPointerType(addrinfo_ptr, addrinfo)
 
 # functions
-socketdll = cdll.load('libc.so.6')
+dllname = ctypes.util.find_library('c')
+socketdll = ctypes.cdll.LoadLibrary(dllname)
 
 socket = socketdll.socket
 socket.argtypes = [c_int, c_int, c_int]



More information about the Pypy-commit mailing list