details: https://code.tryton.org/tryton/commit/0a5dd7fe9d8c
branch: 7.0
user: Cédric Krier <[email protected]>
date: Wed Oct 07 14:02:30 2026 +0200
description:
Test the return of the call to Gio.AppInfo.launch_default_for_uri call
Closes #15153
(grafted from f784af002b0991561c04933e2c30bea22c7ca644)
diffstat:
tryton/tryton/common/common.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r cede4e5fbea7 -r 0a5dd7fe9d8c tryton/tryton/common/common.py
--- a/tryton/tryton/common/common.py Wed Oct 28 13:24:04 2026 +0100
+++ b/tryton/tryton/common/common.py Wed Oct 07 14:02:30 2026 +0200
@@ -577,15 +577,19 @@
else:
uri = GLib.filename_to_uri(filename)
try:
- Gio.AppInfo.launch_default_for_uri(uri)
+ result = Gio.AppInfo.launch_default_for_uri(uri)
except GLib.Error:
+ result = False
+ if not result:
save()
def webbrowser_open(url):
try:
- Gio.AppInfo.launch_default_for_uri(url)
+ result = Gio.AppInfo.launch_default_for_uri(url)
except GLib.Error:
+ result = False
+ if not result:
webbrowser.open(url)