Index: b/Lib/platform.py =================================================================== --- a/Lib/platform.py +++ b/Lib/platform.py @@ -159,12 +159,12 @@ def libc_ver(executable=sys.executable, The file is read and scanned in chunks of chunksize bytes. """ - from distutils.version import LooseVersion as V if hasattr(os.path, 'realpath'): # Python 2.2 introduced os.path.realpath(); it is used # here to work around problems with Cygwin not being # able to open symlinks for reading executable = os.path.realpath(executable) + verinfo = version.split('.') with open(executable, 'rb') as f: binary = f.read(chunksize) pos = 0 @@ -184,19 +184,24 @@ def libc_ver(executable=sys.executable, libcinit, glibc, glibcversion, so, threads, soversion = [ s.decode('latin1') if s is not None else s for s in m.groups()] + glibcverinfo = glibcversion.split('.') + soverinfo = soversion.split('.') if libcinit and not lib: lib = 'libc' elif glibc: if lib != 'glibc': lib = 'glibc' version = glibcversion - elif V(glibcversion) > V(version): + verinfo = glibcverinfo + elif glibcverinfo > verinfo: version = glibcversion + verinfo = glibcverinfo elif so: if lib != 'glibc': lib = 'libc' - if soversion and (not version or V(soversion) > V(version)): + if soversion and (not version or soverinfo > verinfo): version = soversion + verinfo = soverinfo if threads and version[-len(threads):] != threads: version = version + threads pos = m.end()