components/python/python34/patches/21-default-lib-path.patch
changeset 3671 91f76aae1155
equal deleted inserted replaced
3669:91c379bcac7e 3671:91f76aae1155
       
     1 This patch was developed in-house.  It has been submitted upstream:
       
     2 http://bugs.python.org/issue23287
       
     3 
       
     4 --- Python-3.4.2/Lib/ctypes/util.py.~1~	2014-10-08 01:18:12.000000000 -0700
       
     5 +++ Python-3.4.2/Lib/ctypes/util.py	2015-01-20 15:51:09.024341756 -0800
       
     6 @@ -169,23 +169,11 @@
       
     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 -
       
    14 +        def _findLib_path(name, is64):
       
    15              if is64:
       
    16 -                cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
       
    17 +                paths = "/lib/64:/usr/lib/64"
       
    18              else:
       
    19 -                cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
       
    20 -
       
    21 -            with contextlib.closing(os.popen(cmd)) as f:
       
    22 -                for line in f.readlines():
       
    23 -                    line = line.strip()
       
    24 -                    if line.startswith('Default Library Path (ELF):'):
       
    25 -                        paths = line.split()[4]
       
    26 -
       
    27 -            if not paths:
       
    28 -                return None
       
    29 +                paths = "/lib:/usr/lib"
       
    30  
       
    31              for dir in paths.split(":"):
       
    32                  libfile = os.path.join(dir, "lib%s.so" % name)
       
    33 @@ -195,7 +183,7 @@
       
    34              return None
       
    35  
       
    36          def find_library(name, is64 = False):
       
    37 -            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
       
    38 +            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))
       
    39  
       
    40      else:
       
    41