def _find_cmd(cmd):
 paths = System.Environment.GetEnvironmentVariable('PATH').Split(os.pathsep)
 for path in paths:
  filename = os.path.join(path, cmd)
  if System.IO.File.Exists(filename):
   return py3compat.bytes_to_str(filename)
 raise OSError(('command %r not found' % cmd))

def _find_cmd ( cmd ) : paths = System . Environment . GetEnvironmentVariable ( 'PATH' ) . Split ( os . pathsep ) for path in paths : filename = os . path . join ( path , cmd ) if System . IO . File . Exists ( filename ) : return py3compat . bytes_to_str ( filename ) raise OSError ( ( 'command %r not found' % cmd ) )
find the full path to a command using which .