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:
parent
b81ce381f0
commit
a05120412a
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user