author | John Beck <John.Beck@Oracle.COM> |
Mon, 06 Feb 2017 13:54:36 -0800 | |
changeset 7648 | 20e09cf3cfaa |
parent 6447 | 56a2f066191a |
permissions | -rw-r--r-- |
4912 | 1 |
This patch was developed in-house. It has been submitted upstream: |
2 |
http://bugs.python.org/issue23287 |
|
3 |
||
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
4 |
--- Python-3.5.3/Lib/ctypes/util.py.~1~ 2016-12-17 12:05:05.000000000 +0000 |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
5 |
+++ Python-3.5.3/Lib/ctypes/util.py 2016-12-19 08:44:16.426321564 +0000 |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
6 |
@@ -214,34 +214,15 @@ |
4912 | 7 |
|
8 |
elif sys.platform == "sunos5": |
|
9 |
||
10 |
- def _findLib_crle(name, is64): |
|
11 |
- if not os.path.exists('/usr/bin/crle'): |
|
12 |
- return None |
|
13 |
+ def _findLib_path(name, is64): |
|
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
14 |
|
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
15 |
env = dict(os.environ) |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
16 |
env['LC_ALL'] = 'C' |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
17 |
|
4912 | 18 |
if is64: |
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
19 |
- args = ('/usr/bin/crle', '-64') |
4912 | 20 |
+ paths = "/lib/64:/usr/lib/64" |
21 |
else: |
|
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
22 |
- args = ('/usr/bin/crle',) |
4912 | 23 |
- |
6447
56a2f066191a
23858083 Upgrade Python to 3.5.2
John Beck <John.Beck@Oracle.COM>
parents:
4912
diff
changeset
|
24 |
- paths = None |
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
25 |
- try: |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
26 |
- proc = subprocess.Popen(args, |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
27 |
- stdout=subprocess.PIPE, |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
28 |
- stderr=subprocess.DEVNULL, |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
29 |
- env=env) |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
30 |
- except OSError: # E.g. bad executable |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
31 |
- return None |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
32 |
- with proc: |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
33 |
- for line in proc.stdout: |
4912 | 34 |
- line = line.strip() |
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
35 |
- if line.startswith(b'Default Library Path (ELF):'): |
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
36 |
- paths = os.fsdecode(line).split()[4] |
4912 | 37 |
- |
38 |
- if not paths: |
|
39 |
- return None |
|
40 |
+ paths = "/lib:/usr/lib" |
|
41 |
||
42 |
for dir in paths.split(":"): |
|
43 |
libfile = os.path.join(dir, "lib%s.so" % name) |
|
7648
20e09cf3cfaa
25429083 Upgrade Python 3.5 line to 3.5.3
John Beck <John.Beck@Oracle.COM>
parents:
6447
diff
changeset
|
44 |
@@ -251,7 +227,7 @@ |
4912 | 45 |
return None |
46 |
||
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)) |
|
50 |
||
51 |
else: |
|
52 |