]> granicus.if.org Git - python/commitdiff
webbrowser: Silence stderr output if no gconftool or gnome browser found
authorGeorg Brandl <georg@python.org>
Tue, 8 Aug 2006 11:52:34 +0000 (11:52 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 8 Aug 2006 11:52:34 +0000 (11:52 +0000)
Lib/webbrowser.py

index bae0caf4a096fbcf3c7627e5c970e14ebddb1709..7a1a3b4994c0d1b9b0ada43824328bdb39089d17 100644 (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