Windows: Fix version comparison

Fixes #9643
This commit is contained in:
Philipp Hörist 2019-04-05 21:44:35 +02:00
parent 03cc3379d5
commit 0b9aeb0100
1 changed files with 1 additions and 1 deletions

View File

@ -1436,7 +1436,7 @@ class Socks5Listener(IdleObject):
# Under windows Vista, we need that to listen on ipv6 AND ipv4
# Doesn't work under windows XP
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)