webconfig.py: minor polish of is_chromeos_garcon

The `name` attribute I used in commit f725cd402d
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
This commit is contained in:
Ilya Grigoriev 2021-12-29 18:46:50 -08:00 committed by Fabian Homborg
parent 3feb41f78f
commit 084967e560

View file

@ -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):