jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / python / python37 / patches / 14-default-lib-path.patch
blob68c4d7a3ec657428249c5bdcf07029acf6a180d4
1 This patch was developed in-house. It has been submitted upstream:
2 http://bugs.python.org/issue23287
4 --- Python-3.7.1/Lib/ctypes/util.py 2018-11-29 08:05:51.434869759 +0000
5 +++ Python-3.7.1/Lib/ctypes/util.py 2018-11-29 08:05:09.968061983 +0000
6 @@ -213,34 +213,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'):
12 - return None
13 + def _findLib_path(name, is64):
15 env = dict(os.environ)
16 env['LC_ALL'] = 'C'
18 if is64:
19 - args = ('/usr/bin/crle', '-64')
20 + paths = "/lib/64:/usr/lib/64"
21 else:
22 - args = ('/usr/bin/crle',)
24 - paths = None
25 - try:
26 - proc = subprocess.Popen(args,
27 - stdout=subprocess.PIPE,
28 - stderr=subprocess.DEVNULL,
29 - env=env)
30 - except OSError: # E.g. bad executable
31 - return None
32 - with proc:
33 - for line in proc.stdout:
34 - line = line.strip()
35 - if line.startswith(b'Default Library Path (ELF):'):
36 - paths = os.fsdecode(line).split()[4]
38 - if not paths:
39 - return None
40 + paths = "/lib:/usr/lib"
42 for dir in paths.split(":"):
43 libfile = os.path.join(dir, "lib%s.so" % name)
44 @@ -250,7 +231,7 @@ elif os.name == "posix":
45 return None
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))
51 else: