Use six.text_type for improved Python3 support