Commit 140792bd authored by Nick Coghlan's avatar Nick Coghlan Committed by GitHub

bpo-29644: suppress subprocess output from webbrowser (#289)

When checking for the default X web browser, xdg-settings
may emit messages on stderr if some components (such as
kreadconfig5) are unavailable. These messages aren't of
interest to Python, so we just ignore them.
parent 56a8eccc
...@@ -491,7 +491,8 @@ def register_X_browsers(): ...@@ -491,7 +491,8 @@ def register_X_browsers():
if os.environ.get("DISPLAY"): if os.environ.get("DISPLAY"):
try: try:
cmd = "xdg-settings get default-web-browser".split() 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): except (FileNotFoundError, subprocess.CalledProcessError):
pass pass
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment