Use six.text_type instead of six.string_types when checking for the unicode type