#NEWLINE# def send_packed_command( self , command ) : #NEWLINE# #INDENT# 'Send an already packed command to the Redis server' #NEWLINE# if ( not self . _sock ) : #NEWLINE# #INDENT# self . connect ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . _sock . sendall ( self ) #NEWLINE# #UNINDENT# except socket . error : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# self . disconnect ( ) #NEWLINE# if ( len ( e . args ) == 1 ) : #NEWLINE# #INDENT# ( _errno , errmsg ) = ( 'UNKNOWN' , e . args [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( _errno , errmsg ) = e . args #NEWLINE# #UNINDENT# raise ConnectionError ( ( 'Error %s while writing to socket. %s.' % ( _errno , errmsg ) ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . disconnect ( ) #NEWLINE# raise