1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 00:07:14 +03:00

protocol: Work around incompatible types using conditional on wine_get_version

This commit is contained in:
Athanasius 2021-03-08 17:30:43 +00:00
parent 9a82874c7e
commit 165f55bba4

View File

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