From: Neal Norwitz Date: Mon, 3 Apr 2006 06:52:43 +0000 (+0000) Subject: Get ctypes loader working on OSF1 (Tru64) X-Git-Tag: v2.5a1~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0b20a10bccfada2facab090a5f663028c0a8c50;p=python Get ctypes loader working on OSF1 (Tru64) --- diff --git a/Lib/ctypes/_loader.py b/Lib/ctypes/_loader.py index 7bde6c6f29..6ab02961a1 100644 --- a/Lib/ctypes/_loader.py +++ b/Lib/ctypes/_loader.py @@ -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): diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index 84e54e17bd..dd2886c6cc 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -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"