]> granicus.if.org Git - python/commitdiff
Get ctypes loader working on OSF1 (Tru64)
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 3 Apr 2006 06:52:43 +0000 (06:52 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 3 Apr 2006 06:52:43 +0000 (06:52 +0000)
Lib/ctypes/_loader.py
Lib/ctypes/test/test_loading.py

index 7bde6c6f29c67cb2ab909031066c380eab2372b8..6ab02961a18422151b486e392f9a9ae05f2be25f 100644 (file)
@@ -56,7 +56,10 @@ elif os.name == "posix":
         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):
index 84e54e17bd112c6ff0770da60b895d9019b47e17..dd2886c6ccb5e07c7e2d38b9b6b9c553a5e18d49 100644 (file)
@@ -15,7 +15,7 @@ class LoaderTest(unittest.TestCase):
             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"