[Python-checkins] r51137 - python/trunk/Lib/webbrowser.py

georg.brandl python-checkins at python.org
Tue Aug 8 13:52:35 CEST 2006


Author: georg.brandl
Date: Tue Aug  8 13:52:34 2006
New Revision: 51137

Modified:
   python/trunk/Lib/webbrowser.py
Log:
webbrowser: Silence stderr output if no gconftool or gnome browser found



Modified: python/trunk/Lib/webbrowser.py
==============================================================================
--- python/trunk/Lib/webbrowser.py	(original)
+++ python/trunk/Lib/webbrowser.py	Tue Aug  8 13:52:34 2006
@@ -434,13 +434,13 @@
     # 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


More information about the Python-checkins mailing list