blob: a2e9dc865c5322faa61444033f681558c52c28a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
From: Stefano Rivera <stefanor@debian.org>
Date: Sat, 7 Oct 2017 09:38:58 +0200
Subject: Use xdg-open/gvfs-open in webbrowser
Bug-cpython: http://bugs.python.org/issue14493
Bug-Ubuntu: https://bugs.launchpad.net/bugs/971311
Origin: cpython, http://hg.python.org/cpython/rev/70c58903b52e
Author: Michael Vogt <michael.vogt@ubuntu.com>
---
lib-python/2.7/webbrowser.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib-python/2.7/webbrowser.py b/lib-python/2.7/webbrowser.py
index 2389179..645b3e1 100755
--- a/lib-python/2.7/webbrowser.py
+++ b/lib-python/2.7/webbrowser.py
@@ -453,6 +453,14 @@ class Grail(BaseBrowser):
def register_X_browsers():
+ # use xdg-open if around
+ if _iscommand("xdg-open"):
+ register("xdg-open", None, BackgroundBrowser("xdg-open"))
+
+ # The default GNOME3 browser
+ if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gvfs-open"):
+ register("gvfs-open", None, BackgroundBrowser("gvfs-open"))
+
# use xdg-open if around
if _iscommand("xdg-open"):
register("xdg-open", None, BackgroundBrowser("xdg-open"))
|