def write(self, byt):
    self.buffer = (self.buffer + byt)

    def _write():
        if (getattr(self.other, 'transport') is not None):
            self.other.dataReceived(self.buffer)
            self.buffer = b''
            return
        self._reactor.callLater(0.0, _write)
    _write()
def write(self, byt):
    self.buffer = (self.buffer + byt)

    def _write():
        if (getattr(self.other, 'transport') is not None):
            self.other.dataReceived(self.buffer)
            self.buffer = b
            return
        self._reactor.callLater(0.0, _write)
    _write()