components/python/python27/patches/22-default-lib-path.patch
changeset 6445 0edecb568b2e
parent 3671 91f76aae1155
child 7516 09c933391a1b
equal deleted inserted replaced
6442:f900f128dbb9 6445:0edecb568b2e
     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-2.7.9/Lib/ctypes/util.py.~1~	2014-12-10 07:59:34.000000000 -0800
     4 --- Python-2.7.12/Lib/ctypes/util.py.~1~	2016-06-25 14:49:30.000000000 -0700
     5 +++ Python-2.7.9/Lib/ctypes/util.py	2015-01-20 15:22:03.139588641 -0800
     5 +++ Python-2.7.12/Lib/ctypes/util.py	2016-07-07 14:25:48.212744320 -0700
     6 @@ -182,22 +182,11 @@
     6 @@ -176,23 +176,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 -            for line in os.popen(cmd).readlines():
    22 -            for line in os.popen(cmd).readlines():
    22 -                line = line.strip()
    23 -                line = line.strip()
    23 -                if line.startswith('Default Library Path (ELF):'):
    24 -                if line.startswith('Default Library Path (ELF):'):
    24 -                    paths = line.split()[4]
    25 -                    paths = line.split()[4]
    25 -
    26 -
    27 -                return None
    28 -                return None
    28 +                paths = "/lib:/usr/lib"
    29 +                paths = "/lib:/usr/lib"
    29  
    30  
    30              for dir in paths.split(":"):
    31              for dir in paths.split(":"):
    31                  libfile = os.path.join(dir, "lib%s.so" % name)
    32                  libfile = os.path.join(dir, "lib%s.so" % name)
    32 @@ -207,7 +196,7 @@
    33 @@ -202,7 +190,7 @@
    33              return None
    34              return None
    34  
    35  
    35          def find_library(name, is64 = False):
    36          def find_library(name, is64 = False):
    36 -            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
    37 -            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
    37 +            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))
    38 +            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))