1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 03:02:50 +01:00

[oauth] catch exception from 'webbrowser.get()' (#3947)

It raises an exception instead of returning None
when no runnable browser is available.
This commit is contained in:
Mike Fährmann 2023-04-23 15:00:09 +02:00
parent b81ce381f0
commit a05120412a
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -71,8 +71,11 @@ class OAuthBase(Extractor):
browser = self.config("browser", True)
if browser:
import webbrowser
browser = webbrowser.get()
try:
import webbrowser
browser = webbrowser.get()
except Exception:
browser = None
if browser and browser.open(url):
name = getattr(browser, "name", "Browser")