[pypy-svn] r61262 - pypy/trunk/pypy/lib

afa at codespeak.net afa at codespeak.net
Fri Jan 23 15:33:42 CET 2009


Author: afa
Date: Fri Jan 23 15:33:42 2009
New Revision: 61262

Modified:
   pypy/trunk/pypy/lib/ctypes_support.py
   pypy/trunk/pypy/lib/msvcrt.py
Log:
Kill another LoadLibrary which does not use the correct C runtime.
This one was used by the _locale module at least


Modified: pypy/trunk/pypy/lib/ctypes_support.py
==============================================================================
--- pypy/trunk/pypy/lib/ctypes_support.py	(original)
+++ pypy/trunk/pypy/lib/ctypes_support.py	Fri Jan 23 15:33:42 2009
@@ -9,16 +9,12 @@
 
 # __________ the standard C library __________
 
+import _rawffi
+
 if sys.platform == 'win32':
-    # trying to guess the correct libc... only a few tests fail if there
-    # is a mismatch between the one used by python2x.dll and the one
-    # loaded here
-    if sys.version_info < (2, 4):
-        standard_c_lib = ctypes.cdll.LoadLibrary('msvcrt.dll')
-    else:
-        standard_c_lib = ctypes.cdll.LoadLibrary('msvcr71.dll')
+    standard_c_lib = ctypes.CDLL('msvcrt', handle=_rawffi.get_libc())
 else:
-    standard_c_lib = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
+    standard_c_lib = ctypes.CDLL(ctypes.util.find_library('c'))
 
 if sys.platform == 'win32':
     standard_c_lib._errno.restype = ctypes.POINTER(ctypes.c_int)

Modified: pypy/trunk/pypy/lib/msvcrt.py
==============================================================================
--- pypy/trunk/pypy/lib/msvcrt.py	(original)
+++ pypy/trunk/pypy/lib/msvcrt.py	Fri Jan 23 15:33:42 2009
@@ -6,10 +6,8 @@
 
 # XXX incomplete: implemented only functions needed by subprocess.py
 
-import _rawffi
 import ctypes
-
-_c = ctypes.CDLL('msvcrt', handle=_rawffi.get_libc())
+from ctypes_support import standard_c_lib as _c
 
 open_osfhandle = _c._open_osfhandle
 open_osfhandle.argtypes = [ctypes.c_int, ctypes.c_int]



More information about the Pypy-commit mailing list