From f4b4e9cc885ebc3eb77a924123db6695f56c078e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 15 Feb 2019 16:56:52 +0100 Subject: [PATCH] Determine windows version reliably Fixes #9578 --- gajim/common/zeroconf/client_zeroconf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gajim/common/zeroconf/client_zeroconf.py b/gajim/common/zeroconf/client_zeroconf.py index 29f6b893b..d2a454682 100644 --- a/gajim/common/zeroconf/client_zeroconf.py +++ b/gajim/common/zeroconf/client_zeroconf.py @@ -26,7 +26,6 @@ from gajim.common.zeroconf import zeroconf from nbxmpp.protocol import * import socket -import platform import ssl import errno import sys @@ -73,7 +72,7 @@ class ZeroconfListener(IdleObject): self._serv.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) self._serv.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) if os.name == 'nt': - if int(platform.win32_ver()[0]) >= 6: # Win Vista + + if sys.getwindowsversion().major >= 6: # Win Vista + # 47 is socket.IPPROTO_IPV6 # 27 is socket.IPV6_V6ONLY under windows, but not defined ... self._serv.setsockopt(41, 27, 0)