(cmd)
return LooseVersion(result.group(1).decode())
Find the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
Find the version of an executable by running `cmd` in the shell.
Find the version of an executable by running cmd in the shell .
def _find_exe_version(cmd):
    """Find the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    """
    executable = cmd.split()[0]
    if find_executable(executable) is None:
        return None
    out = Popen(cmd, shell=True, stdout=PIPE).stdout
    try:
        out_string = out.read()
    finally:
        out.close()
    result = RE_VERSION.search(out_string)
    if result is None:
        return None
    # LooseVersion works with strings
    # so we need to decode our bytes
    return LooseVersion(result.group(1).decode())
def _find_exe_version ( cmd ) : executable = cmd . split ( ) [ 0 ] if find_executable ( executable ) is None : return None out = Popen ( cmd , shell = True , stdout = PIPE ) . stdout try : out_string = out . read ( ) finally : out . close ( ) result = RE_VERSION . search ( out_string ) if result is None : return None # LooseVersion works with strings # so we need to decode our bytes return LooseVersion ( result . group ( 1 ) . decode ( ) )