components/python/python35/patches/21-default-lib-path.patch
changeset 6447 56a2f066191a
parent 4912 0b79e9575718
child 7648 20e09cf3cfaa
equal deleted inserted replaced
6446:b54de573b4e9 6447:56a2f066191a
     1 This patch was developed in-house.  It has been submitted upstream:
     1 This patch was developed in-house.  It has been submitted upstream:
     2 http://bugs.python.org/issue23287
     2 http://bugs.python.org/issue23287
     3 
     3 
     4 --- Python-3.5.0a4/Lib/ctypes/util.py.~1~	2015-04-20 00:37:51.000000000 -0700
     4 --- Python-3.5.2/Lib/ctypes/util.py.~1~	2016-06-25 14:38:35.000000000 -0700
     5 +++ Python-3.5.0a4/Lib/ctypes/util.py	2015-04-20 14:14:06.541902625 -0700
     5 +++ Python-3.5.2/Lib/ctypes/util.py	2016-07-08 07:06:45.026306406 -0700
     6 @@ -175,23 +175,11 @@
     6 @@ -175,24 +175,11 @@
     7  
     7  
     8      elif sys.platform == "sunos5":
     8      elif sys.platform == "sunos5":
     9  
     9  
    10 -        def _findLib_crle(name, is64):
    10 -        def _findLib_crle(name, is64):
    11 -            if not os.path.exists('/usr/bin/crle'):
    11 -            if not os.path.exists('/usr/bin/crle'):
    16 -                cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
    16 -                cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
    17 +                paths = "/lib/64:/usr/lib/64"
    17 +                paths = "/lib/64:/usr/lib/64"
    18              else:
    18              else:
    19 -                cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
    19 -                cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
    20 -
    20 -
       
    21 -            paths = None
    21 -            with contextlib.closing(os.popen(cmd)) as f:
    22 -            with contextlib.closing(os.popen(cmd)) as f:
    22 -                for line in f.readlines():
    23 -                for line in f.readlines():
    23 -                    line = line.strip()
    24 -                    line = line.strip()
    24 -                    if line.startswith('Default Library Path (ELF):'):
    25 -                    if line.startswith('Default Library Path (ELF):'):
    25 -                        paths = line.split()[4]
    26 -                        paths = line.split()[4]
    28 -                return None
    29 -                return None
    29 +                paths = "/lib:/usr/lib"
    30 +                paths = "/lib:/usr/lib"
    30  
    31  
    31              for dir in paths.split(":"):
    32              for dir in paths.split(":"):
    32                  libfile = os.path.join(dir, "lib%s.so" % name)
    33                  libfile = os.path.join(dir, "lib%s.so" % name)
    33 @@ -201,7 +189,7 @@
    34 @@ -202,7 +189,7 @@
    34              return None
    35              return None
    35  
    36  
    36          def find_library(name, is64 = False):
    37          def find_library(name, is64 = False):
    37 -            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
    38 -            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
    38 +            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))
    39 +            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))