def check_splitter(command):
 try:
  env = os.environ.copy()
  if ('xld' in command):
   env['PATH'] += (os.pathsep + '/Applications')
  elif headphones.CONFIG.CUE_SPLIT_FLAC_PATH:
   command = os.path.join(headphones.CONFIG.CUE_SPLIT_SHNTOOL_PATH, 'shntool')
  devnull = open(os.devnull)
  subprocess.Popen([command], stdout=devnull, stderr=devnull, env=env).communicate()
 except OSError as e:
  if (e.errno == os.errno.ENOENT):
   return False
 return True

def check_splitter ( command ) : try : env = os . environ . copy ( ) if ( 'xld' in command ) : env [ 'PATH' ] += ( os . pathsep + '/Applications' ) elif headphones . CONFIG . CUE_SPLIT_FLAC_PATH : command = os . path . join ( headphones . CONFIG . CUE_SPLIT_SHNTOOL_PATH , 'shntool' ) devnull = open ( os . devnull ) subprocess . Popen ( [ command ] , stdout = devnull , stderr = devnull , env = env ) . communicate ( ) except OSError as e : if ( e . errno == os . errno . ENOENT ) : return False return True
check xld or shntool installed .