components/python/python26/patches/Python26-14-ctypes-util-find-library.patch
branchs11u3-sru
changeset 7811 9126e6f58cd8
parent 7792 ee802f9b5132
child 7816 79ee06fdecc5
equal deleted inserted replaced
7792:ee802f9b5132 7811:9126e6f58cd8
     1 This patch was developed in-house, but not contributed upstream because
       
     2 Python 2.6 has been abandoned by the community.
       
     3 
       
     4 --- Python-2.6.8/Lib/ctypes/util.py.~1~	2012-04-10 08:32:04.000000000 -0700
       
     5 +++ Python-2.6.8/Lib/ctypes/util.py	2015-01-20 15:17:51.156728249 -0800
       
     6 @@ -164,6 +164,24 @@
       
     7              res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y)))
       
     8              return res[-1]
       
     9  
       
    10 +    elif sys.platform == "sunos5":
       
    11 +
       
    12 +        def _findLib_path(name, is64):
       
    13 +            if is64:
       
    14 +                paths = "/lib/64:/usr/lib/64"
       
    15 +            else:
       
    16 +                paths = "/lib:/usr/lib"
       
    17 +
       
    18 +            for dir in paths.split(":"):
       
    19 +                libfile = os.path.join(dir, "lib%s.so" % name)
       
    20 +                if os.path.exists(libfile):
       
    21 +                    return libfile
       
    22 +
       
    23 +            return None
       
    24 +        
       
    25 +        def find_library(name, is64 = False):
       
    26 +            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))
       
    27 +
       
    28      else:
       
    29  
       
    30          def _findLib_ldconfig(name):