Replace basestring with six.string_types