#NEWLINE# def __validate( self ) : #NEWLINE# #INDENT# if isinstance ( self . protocol_versions , list ) : #NEWLINE# #INDENT# for i in xrange ( len ( self . protocol_versions ) ) : #NEWLINE# #INDENT# protocol_version = self . protocol_versions [ i ] #NEWLINE# if ( not isinstance ( protocol_version , ProtocolVersion ) ) : #NEWLINE# #INDENT# msg = 'invalid protocol version ({0} in list)' . format ( i ) #NEWLINE# msg += '; expected {0}, received {1}' . format ( ProtocolVersion , protocol_version ) #NEWLINE# raise TypeError ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# msg = 'invalid protocol versions list' #NEWLINE# msg += '; expected {0}, received {1}' . format ( list , self . protocol_versions ) #NEWLINE# raise TypeError ( msg )