Skip to content

exe

libc_version()

Get the version of glibc this python was compiled with return None if we don't have any info on it

Source code in chmpy/util/exe.py
def libc_version():
    """Get the version of glibc this python was compiled with
    return None if we don't have any info on it
    """
    try:
        version = platform.libc_ver()[1]
    except Exception:
        version = None
    return version

linux_version()

Get the version of linux this system is running If it's not linux, return None

Source code in chmpy/util/exe.py
def linux_version():
    """Get the version of linux this system is running
    If it's not linux, return None
    """
    s = platform.platform()
    if not s.startswith("Linux"):
        return None
    version_string = s.split("-")[1]
    return version_string