From 165f55bba48c9939a4cdbe4bdc8fcaecc2fdcc9d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 8 Mar 2021 17:30:43 +0000 Subject: [PATCH] protocol: Work around incompatible types using conditional on wine_get_version --- protocol.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocol.py b/protocol.py index e6184a5e..83b10e87 100644 --- a/protocol.py +++ b/protocol.py @@ -21,7 +21,8 @@ is_wine = False if sys.platform == 'win32': from ctypes import windll # type: ignore try: - is_wine = windll.ntdll.wine_get_version + if windll.ntdll.wine_get_version: + is_wine = True except Exception: pass @@ -398,7 +399,7 @@ protocolhandler: GenericProtocolHandler if sys.platform == 'darwin' and getattr(sys, 'frozen', False): protocolhandler = DarwinProtocolHandler() # pyright: reportUnboundVariable=false -elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine: +elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine and not config.auth_force_localserver: protocolhandler = WindowsProtocolHandler() else: protocolhandler = LinuxProtocolHandler()