Use six.text_type rather than str.