mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Ported to Windows:
- Set the host to "localhost" instead of "". - Skip the AF_UNIX tests when socket.AF_UNIX is not defined.
This commit is contained in:
parent
12060e5ed3
commit
05be1a0fd6
1 changed files with 6 additions and 5 deletions
|
@ -90,7 +90,7 @@ def pickport():
|
||||||
seed += 1
|
seed += 1
|
||||||
return 10000 + (os.getpid() % 1000)*10 + seed
|
return 10000 + (os.getpid() % 1000)*10 + seed
|
||||||
|
|
||||||
host = ""
|
host = "localhost"
|
||||||
testfiles = []
|
testfiles = []
|
||||||
def pickaddr(proto):
|
def pickaddr(proto):
|
||||||
if proto == socket.AF_INET:
|
if proto == socket.AF_INET:
|
||||||
|
@ -147,10 +147,11 @@ else:
|
||||||
def testall():
|
def testall():
|
||||||
testloop(socket.AF_INET, tcpservers, MyStreamHandler, teststream)
|
testloop(socket.AF_INET, tcpservers, MyStreamHandler, teststream)
|
||||||
testloop(socket.AF_INET, udpservers, MyDatagramHandler, testdgram)
|
testloop(socket.AF_INET, udpservers, MyDatagramHandler, testdgram)
|
||||||
testloop(socket.AF_UNIX, streamservers, MyStreamHandler, teststream)
|
if hasattr(socket, 'AF_UNIX'):
|
||||||
# Alas, on Linux (at least) recvfrom() doesn't return a meaningful
|
testloop(socket.AF_UNIX, streamservers, MyStreamHandler, teststream)
|
||||||
# client address so this cannot work:
|
# Alas, on Linux (at least) recvfrom() doesn't return a meaningful
|
||||||
##testloop(socket.AF_UNIX, dgramservers, MyDatagramHandler, testdgram)
|
# client address so this cannot work:
|
||||||
|
##testloop(socket.AF_UNIX, dgramservers, MyDatagramHandler, testdgram)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue