From: Alfredo Deza Date: Wed, 29 Jan 2014 17:46:43 +0000 (-0500) Subject: prevent None struct to be used in to_io X-Git-Tag: 0.0.14~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d986994eece07d8bb0a4700e3239664240e9f405;p=remoto.git prevent None struct to be used in to_io --- diff --git a/remoto/lib/execnet/gateway_base.py b/remoto/lib/execnet/gateway_base.py index 30e6e1a..45b2351 100644 --- a/remoto/lib/execnet/gateway_base.py +++ b/remoto/lib/execnet/gateway_base.py @@ -376,9 +376,10 @@ class Message: return Message(msgtype, channel, io.read(payload)) def to_io(self, io): - header = struct.pack('!bii', self.msgcode, self.channelid, - len(self.data)) - io.write(header+self.data) + if struct.pack is not None: + header = struct.pack('!bii', self.msgcode, self.channelid, + len(self.data)) + io.write(header+self.data) def received(self, gateway): self._types[self.msgcode](self, gateway)