diff -r dc353953ce8b Lib/ctypes/util.py --- a/Lib/ctypes/util.py Sun May 25 18:28:39 2014 -0700 +++ b/Lib/ctypes/util.py Sun May 25 20:21:40 2014 -0700 @@ -113,11 +113,17 @@ if sys.platform == "sunos5": - # use /usr/ccs/bin/dump on solaris + # /usr/ccs/bin/dump for Solaris10, + # /usr/bin/dump for SmartOs, OpenIndiana, et. al def _get_soname(f): if not f: return None - cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f + for dump_cmd in ("/usr/ccs/bin/dump", "/usr/bin/dump",): + if os.path.exists(dump_cmd): + cmd = dump_cmd + " -Lpv 2>/dev/null " + f + break + else: + return None with contextlib.closing(os.popen(cmd)) as f: data = f.read() res = re.search(r'\[.*\]\sSONAME\s+([^\s]+)', data)