From b0b20a10bccfada2facab090a5f663028c0a8c50 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Mon, 3 Apr 2006 06:52:43 +0000 Subject: Get ctypes loader working on OSF1 (Tru64) --- Lib/ctypes/_loader.py | 5 ++++- Lib/ctypes/test/test_loading.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/ctypes/_loader.py b/Lib/ctypes/_loader.py index 7bde6c6..6ab0296 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 84e54e1..dd2886c 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" -- cgit v0.12