Validate the server certificate for HTTPS connections
[zeroinstall.git] / zeroinstall / 0launch-gui / browser.py
bloba930cd73ea3dceedf5a949b0b6839d9d3c117b16
1 # Copyright (C) 2009, Thomas Leonard
2 # See the README file for details, or visit http://0install.net.
4 import os, sys
6 def open_in_browser(link):
7 browser = os.environ.get('BROWSER', 'firefox')
8 child = os.fork()
9 if child == 0:
10 # We are the child
11 try:
12 os.spawnlp(os.P_NOWAIT, browser, browser, link)
13 os._exit(0)
14 except Exception as ex:
15 print >>sys.stderr, "Error", ex
16 os._exit(1)
17 os.waitpid(child, 0)