[svn r37317] Fixed execnet tests on Windows, for some reason it uses '0.0.0.0' as IP address if '' is given as hostname

--HG--
branch : trunk
This commit is contained in:
guido 2007-01-25 11:16:35 +01:00
parent 1e7d516666
commit 039ec87c64
1 changed files with 7 additions and 3 deletions

View File

@ -145,7 +145,9 @@ class SocketGateway(InstallableGateway):
given gateway.
"""
if hostport is None:
host, port = ('', 0)
# XXX not sure about this one... is this what's intended? it used
# to use '' for the hostname, which breaks Windows...
host, port = ('127.0.0.1', 0)
else:
host, port = hostport
socketserverbootstrap = py.code.Source(
@ -160,8 +162,10 @@ class SocketGateway(InstallableGateway):
# execute the above socketserverbootstrap on the other side
channel = gateway.remote_exec(socketserverbootstrap)
hostname, (realhost, realport) = channel.receive()
if not hostname:
realhost = hostname
if not hostname:
# XXX this is strange... shouldn't it be 'realhost = hostname' or
# something?
hostname = realhost
#gateway._trace("remote_install received"
# "port=%r, hostname = %r" %(realport, hostname))
return py.execnet.SocketGateway(realhost, realport)