diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index a9eac696505..fb6c83b19be 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -491,7 +491,8 @@ def register_X_browsers(): if os.environ.get("DISPLAY"): try: cmd = "xdg-settings get default-web-browser".split() - result = subprocess.check_output(cmd).decode().strip() + raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL) + result = raw_result.decode().strip() except (FileNotFoundError, subprocess.CalledProcessError): pass else: