#NEWLINE# def encode( self , value ) : #NEWLINE# #INDENT# if ( not isinstance ( self , datetime . time ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'expected a datetime.time, not ' + repr ( value ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( value . tzinfo is None ) : #NEWLINE# #INDENT# raise ValueError ( 'datetime.time must be aware of tzinfo' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( value . tzinfo is UTC ) : #NEWLINE# #INDENT# result = ( value . replace ( tzinfo = None ) . isoformat ( ) + 'Z' ) #NEWLINE# return result . encode ( 'ascii' ) #NEWLINE# #UNINDENT# return value . isoformat ( ) . encode ( 'ascii' )