mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
merge 3.3 (#5289)
This commit is contained in:
commit
d41e01dfb5
3 changed files with 32 additions and 0 deletions
|
|
@ -166,6 +166,35 @@ elif os.name == "posix":
|
|||
res.sort(key=_num_version)
|
||||
return res[-1]
|
||||
|
||||
elif sys.platform == "sunos5":
|
||||
|
||||
def _findLib_crle(name, is64):
|
||||
if not os.path.exists('/usr/bin/crle'):
|
||||
return None
|
||||
|
||||
if is64:
|
||||
cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
|
||||
else:
|
||||
cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
|
||||
|
||||
for line in os.popen(cmd).readlines():
|
||||
line = line.strip()
|
||||
if line.startswith('Default Library Path (ELF):'):
|
||||
paths = line.split()[4]
|
||||
|
||||
if not paths:
|
||||
return None
|
||||
|
||||
for dir in paths.split(":"):
|
||||
libfile = os.path.join(dir, "lib%s.so" % name)
|
||||
if os.path.exists(libfile):
|
||||
return libfile
|
||||
|
||||
return None
|
||||
|
||||
def find_library(name, is64 = False):
|
||||
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
|
||||
|
||||
else:
|
||||
|
||||
def _findSoname_ldconfig(name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue