components/python/python35/patches/21-default-lib-path.patch
author John Beck <John.Beck@Oracle.COM>
Thu, 21 Jul 2016 12:52:32 -0700
changeset 6447 56a2f066191a
parent 4912 0b79e9575718
child 7648 20e09cf3cfaa
permissions -rw-r--r--
23858083 Upgrade Python to 3.5.2

This patch was developed in-house.  It has been submitted upstream:
http://bugs.python.org/issue23287

--- Python-3.5.2/Lib/ctypes/util.py.~1~	2016-06-25 14:38:35.000000000 -0700
+++ Python-3.5.2/Lib/ctypes/util.py	2016-07-08 07:06:45.026306406 -0700
@@ -175,24 +175,11 @@
 
     elif sys.platform == "sunos5":
 
-        def _findLib_crle(name, is64):
-            if not os.path.exists('/usr/bin/crle'):
-                return None
-
+        def _findLib_path(name, is64):
             if is64:
-                cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
+                paths = "/lib/64:/usr/lib/64"
             else:
-                cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
-
-            paths = None
-            with contextlib.closing(os.popen(cmd)) as f:
-                for line in f.readlines():
-                    line = line.strip()
-                    if line.startswith('Default Library Path (ELF):'):
-                        paths = line.split()[4]
-
-            if not paths:
-                return None
+                paths = "/lib:/usr/lib"
 
             for dir in paths.split(":"):
                 libfile = os.path.join(dir, "lib%s.so" % name)
@@ -202,7 +189,7 @@
             return None
 
         def find_library(name, is64 = False):
-            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
+            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))
 
     else: