Example #1
0
 def _send_loop(self):
     while True:
         command = force_bytes(self._send_queue.get())
         try:
             self._socket.sendall(command)
         except Exception:
             eventlet.spawn(self.reconnect)
             return
Example #2
0
 def _send_loop(self):
     while True:
         command = force_bytes(self._send_queue.get())
         self.logger.debug('send: %r', command[:-2])
         try:
             self._socket.sendall(command)
         except Exception:
             self.logger.exception("Client._send_loop failed")
             gevent.spawn(self.reconnect)
             return
Example #3
0
 def test_force_bytes_b(self):
     self.assertTrue(isinstance(force_bytes(b"HELLO"), str))
Example #4
0
 def test_force_bytes_u(self):
     self.assertTrue(isinstance(force_bytes(u"HELLO"), bytes))