webbrowser: Silence stderr output if no gconftool or gnome browser found

This commit is contained in:
Georg Brandl 2006-08-08 11:52:34 +00:00
parent 8607042889
commit f3321b5e76
1 changed files with 2 additions and 2 deletions

View File

@ -434,13 +434,13 @@ def register_X_browsers():
# The default Gnome browser
if _iscommand("gconftool-2"):
# get the web browser string from gconftool
gc = 'gconftool-2 -g /desktop/gnome/url-handlers/http/command'
gc = 'gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null'
out = os.popen(gc)
commd = out.read().strip()
retncode = out.close()
# if successful, register it
if retncode == None and len(commd) != 0:
if retncode is None and commd:
register("gnome", None, BackgroundBrowser(commd))
# First, the Mozilla/Netscape browsers