[Python-checkins] r43574 - in python/trunk/Lib/ctypes: _loader.py test/test_loading.py

neal.norwitz python-checkins at python.org
Mon Apr 3 08:52:43 CEST 2006


Author: neal.norwitz
Date: Mon Apr  3 08:52:43 2006
New Revision: 43574

Modified:
   python/trunk/Lib/ctypes/_loader.py
   python/trunk/Lib/ctypes/test/test_loading.py
Log:
Get ctypes loader working on OSF1 (Tru64)

Modified: python/trunk/Lib/ctypes/_loader.py
==============================================================================
--- python/trunk/Lib/ctypes/_loader.py	(original)
+++ python/trunk/Lib/ctypes/_loader.py	Mon Apr  3 08:52:43 2006
@@ -56,7 +56,10 @@
         expr = '/[^\(\)\s]*lib%s\.[^\(\)\s]*' % name
         res = re.search(expr, os.popen('/sbin/ldconfig -p 2>/dev/null').read())
         if not res:
-            return None
+            cmd = 'ldd %s 2>/dev/null' % sys.executable
+            res = re.search(expr, os.popen(cmd).read())
+            if not res:
+                return None
         return res.group(0)
 
     def _get_soname(f):

Modified: python/trunk/Lib/ctypes/test/test_loading.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_loading.py	(original)
+++ python/trunk/Lib/ctypes/test/test_loading.py	Mon Apr  3 08:52:43 2006
@@ -15,7 +15,7 @@
             name = "libc.dylib"
         elif sys.platform.startswith("freebsd"):
             name = "libc.so"
-        elif sys.platform == "sunos5":
+        elif sys.platform in ("sunos5", "osf1V5"):
             name = "libc.so"
         elif sys.platform.startswith("netbsd") or sys.platform.startswith("openbsd"):
             name = "libc.so"


More information about the Python-checkins mailing list