def open(url):

  try:
    webbrowser.open(url, new=1, autoraise=True)
  # If the user is missing the osascript binary - see
  # http://code.google.com/p/namebench/issues/detail?id=88
  except:
    output('Failed to open: [%s]: %s' % (url, util.GetLastExceptionString()))
    if os.path.exists('/usr/bin/open'):
      try:
        output('trying open: %s' % url)
        p = subprocess.Popen(('open', url))
        p.wait()
      except:
        output('open did not seem to work: %s' % util.GetLastExceptionString())
    elif sys.platform[:3] == 'win':
      try:
        output('trying default Windows controller: %s' % url)
        controller = webbrowser.get('windows-default')
        controller.open_new(url)
      except:
        output('WindowsController did not work: %s' % util.GetLastExceptionString())


# *NOTE*: EVIL IMPORT SIDE EFFECTS AHEAD!
#
# If we are running on Windows, register the WindowsHttpDefault class.
Opens a URL, overriding the normal webbrowser.open methods for sanity.
dataset/ETHPy150Open catap/namebench/libnamebench/better_webbrowser.py/open