more windows2000 support

This commit is contained in:
ed 2024-06-18 12:01:21 +02:00
parent 8c73e0cbc2
commit 2fd12a839c
2 changed files with 4 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import time
import queue
from .__init__ import ANYWIN, CORES, EXE, MACOS, TYPE_CHECKING, EnvParams
from .__init__ import ANYWIN, CORES, EXE, MACOS, TYPE_CHECKING, EnvParams, unicode
try:
MNFE = ModuleNotFoundError
@ -335,11 +335,11 @@ class HttpSrv(object):
try:
sck, saddr = srv_sck.accept()
cip, cport = saddr[:2]
cip = unicode(saddr[0])
if cip.startswith("::ffff:"):
cip = cip[7:]
addr = (cip, cport)
addr = (cip, saddr[1])
except (OSError, socket.error) as ex:
if self.stopping:
break

View file

@ -162,6 +162,7 @@ try:
socket.inet_pton(socket.AF_INET6, "::1")
HAVE_IPV6 = True
except:
def inet_pton(fam, ip):
return socket.inet_aton(ip)