def connect(self):
if not getattr(self._local, '<STR_LIT>', None):<EOL><INDENT>try:<EOL><INDENT>server = self._servers.get()<EOL>logger.debug('<STR_LIT>', server)<EOL>self._local.conn = ClientTransport(server, self._framed_transport,<EOL>self._timeout, self._recycle)<EOL><DEDENT>except (Thrift.TException, socket.timeout, socket.error):<EOL><INDENT>logger.warning('<STR_LIT>', server)<EOL>self._servers.mark_dead(server)<EOL>return self.connect()<EOL><DEDENT><DEDENT>return self._local.conn<EOL>
Create new connection unless we already have one.