From 205f960ed4090b203bcfffa0fd0d7c1250b5f9e1 Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 10 Oct 2021 12:59:03 +0200 Subject: [PATCH] [utils] Disable webview on Windows if Edgium renderer not available CEF should also work, but is untested. --- legendary/utils/webview_login.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/legendary/utils/webview_login.py b/legendary/utils/webview_login.py index 0c33123..fe8a9f1 100644 --- a/legendary/utils/webview_login.py +++ b/legendary/utils/webview_login.py @@ -1,5 +1,6 @@ import logging import json +import os import webbrowser from legendary import __version__ @@ -12,7 +13,9 @@ try: # silence logger webview.logger.setLevel(logging.FATAL) - webview.initialize() + gui = webview.initialize() + if gui and os.name == 'nt' and gui.renderer not in ('edgechromium', 'cef'): + raise NotImplementedError(f'Renderer {gui.renderer} not supported on Windows.') except Exception as e: logger.debug(f'Webview unavailable, disabling webview login (Exception: {e!r}).') webview_available = False