#NEWLINE# def fix_unicode( self , token ) : #NEWLINE# #INDENT# if ( token . type == 'identifier' ) : #NEWLINE# #INDENT# if ( ( token . text == 'chr' ) and ( token . next_char == '(' ) ) : #NEWLINE# #INDENT# token . fix = 'unichr' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( token . text == 'str' ) and ( token . next_char == '(' ) ) : #NEWLINE# #INDENT# token . fix = 'unicode' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( token . text == 'str' ) and ( ( self . next_char == ')' ) and ( token . prev_char == '(' ) and ( token . line_tokens [ 0 ] . text == 'class' ) ) ) : #NEWLINE# #INDENT# token . fix = 'unicode' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( token . text == 'isinstance' ) and ( token . next_char == '(' ) ) : #NEWLINE# #INDENT# end = token . find_forward ( ')' ) #NEWLINE# t = token . next_token #NEWLINE# while ( t . next_token and ( t . next_token . start < end ) ) : #NEWLINE# #INDENT# t = t . next_token #NEWLINE# if ( t . text == 'str' ) : #NEWLINE# #INDENT# t . fix = 'basestring'