      """
      Checks if an input value is a localizable type and returns it
      formatted with the appropriate formatting string of the current locale.
      """
      if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
          return value
      elif isinstance(value, bool):  # Don't treat booleans as numbers.
          return six.text_type(value)
      elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
          return number_format(value)
 
</s> remove         return six.text_type(value)
    elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
 </s> add         return str(value)
    elif isinstance(value, (decimal.Decimal, float, int)): </s> remove     if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
 </s> add     if isinstance(value, str):  # Handle strings first for performance reasons. </s> remove         return mark_safe(six.text_type(value))
    elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
 </s> add         return mark_safe(str(value))
    elif isinstance(value, (decimal.Decimal, float, int)): </s> remove         elif isinstance(value, six.string_types):
            return "'%s'" % six.text_type(value).replace("\'", "\'\'")
        elif isinstance(value, six.buffer_types):
 </s> add         elif isinstance(value, str):
            return "'%s'" % value.replace("\'", "\'\'")
        elif isinstance(value, (bytes, bytearray, memoryview)): </s> remove         elif f.geom_type == 'RASTER' and isinstance(value, six.string_types):
 </s> add         elif f.geom_type == 'RASTER' and isinstance(value, str):
    if isinstance(value, str):  # Handle strings first for performance reasons.
      """
      Checks if an input value is a localizable type and returns it
      formatted with the appropriate formatting string of the current locale.
      """
    if isinstance(value, str):  # Handle strings first for performance reasons.
          return value
      elif isinstance(value, bool):  # Don't treat booleans as numbers.
          return six.text_type(value)
      elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
          return number_format(value)
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/utils/formats.py