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
 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 return LooseVersion ( result . group ( 1 ) . decode ( ) )
find the version of an executable by running cmd in the shell .