1 This patch was developed in-house. It has been submitted upstream:
2 http://bugs.python.org/issue23287
4 --- Python-3.9.1/Lib/ctypes/util.py
5 +++ Python-3.9.1/Lib/ctypes/util.py
6 @@ -226,34 +226,15 @@ elif os.name == "posix":
8 elif sys.platform == "sunos5":
10 - def _findLib_crle(name, is64):
11 - if not os.path.exists('/usr/bin/crle'):
13 + def _findLib_path(name, is64):
15 env = dict(os.environ)
19 - args = ('/usr/bin/crle', '-64')
20 + paths = "/lib/64:/usr/lib/64"
22 - args = ('/usr/bin/crle',)
26 - proc = subprocess.Popen(args,
27 - stdout=subprocess.PIPE,
28 - stderr=subprocess.DEVNULL,
30 - except OSError: # E.g. bad executable
33 - for line in proc.stdout:
35 - if line.startswith(b'Default Library Path (ELF):'):
36 - paths = os.fsdecode(line).split()[4]
40 + paths = "/lib:/usr/lib"
42 for dir in paths.split(":"):
43 libfile = os.path.join(dir, "lib%s.so" % name)
44 @@ -263,7 +244,7 @@ elif os.name == "posix":
47 def find_library(name, is64 = False):
48 - return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
49 + return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))