Use string_types rather than basestring.