diff --git a/py/execnet/gateway.py b/py/execnet/gateway.py index 244ef252a..b1ad35169 100644 --- a/py/execnet/gateway.py +++ b/py/execnet/gateway.py @@ -55,12 +55,16 @@ class Gateway(object): addr = '[%s]' % (addr,) else: addr = '' - r = (len(self.pool.getstarted('receiver')) - and "receiving" or "not receiving") - s = (len(self.pool.getstarted('sender')) - and "sending" or "not sending") - i = len(self.channelfactory.channels()) - return "<%s%s %s/%s (%d active channels)>" %( + try: + r = (len(self.pool.getstarted('receiver')) + and "receiving" or "not receiving") + s = (len(self.pool.getstarted('sender')) + and "sending" or "not sending") + i = len(self.channelfactory.channels()) + except AttributeError: + r = s = "uninitialized" + i = "no" + return "<%s%s %s/%s (%s active channels)>" %( self.__class__.__name__, addr, r, s, i) def _getremoteaddress(self): diff --git a/py/execnet/register.py b/py/execnet/register.py index b90f770a1..b3478e60f 100644 --- a/py/execnet/register.py +++ b/py/execnet/register.py @@ -40,7 +40,7 @@ class InstallableGateway(gateway.Gateway): gateway starts with odd numbers. This allows to uniquely identify channels across both sides. """ - bootstrap = ["we_are_remote=True", extra] + bootstrap = [extra] bootstrap += [getsource(x) for x in startup_modules] bootstrap += [io.server_stmt, "Gateway(io=io, startcount=2).join(joinexec=False)",] source = "\n".join(bootstrap) @@ -135,7 +135,7 @@ class SocketGateway(InstallableGateway): self.port = port = int(port) sock.connect((host, port)) io = inputoutput.SocketIO(sock) - InstallableGateway.__init__(self, io=io) + super(SocketGateway, self).__init__(io=io) def _getremoteaddress(self): return '%s:%d' % (self.host, self.port)