From 084967e56063d77bf20519958a80cbb00e36ce49 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Wed, 29 Dec 2021 18:46:50 -0800 Subject: [PATCH] webconfig.py: minor polish of `is_chromeos_garcon` The `name` attribute I used in commit f725cd402d0324b2660a1fda2ac299d5ac146593 is undocumented, and [someone discovered] that it does not exist for one possible browser on MacOS. This should make the code work correctly even in that case. This probably doesn't currently cause a problem, at least when `isMacOS10_12_5_OrLater()` is true, because of the ordering of the if statements in the `runThing` function. [someone discovered]: https://bugs.python.org/issue43424#msg409087 --- share/tools/web_config/webconfig.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 254f98d77..c5b5290ab 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -93,7 +93,10 @@ def is_chromeos_garcon(): # Linux filesystem. This uses Garcon, see for example # https://chromium.googlesource.com/chromiumos/platform2/+/master/vm_tools/garcon/#opening-urls # https://source.chromium.org/search?q=garcon-url-handler - return "garcon-url-handler" in webbrowser.get().name + try: + return "garcon-url-handler" in webbrowser.get().name + except AttributeError: + return False def run_fish_cmd(text):