Skip to content
Snippets Groups Projects
Commit a944e7e6 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Determine windows version reliably

Fixes #9578
parent 8455a0fa
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import socket
import platform
import ssl
import errno
import sys
......@@ -76,7 +75,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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment