Converting basestring to compat.string_types