                  s = six.text_type(s, encoding, errors)
              else:
                  s = six.text_type(s)
          else:
              # Note: We use .decode() here, instead of six.text_type(s, encoding,
              # errors), so that if s is a SafeBytes, it ends up being a
              # SafeText at the end.
              s = s.decode(encoding, errors)
      except UnicodeDecodeError as e:
          if not isinstance(s, Exception):
 
</s> remove                 s = six.text_type(s)
 </s> add                 s = str(s) </s> remove                 s = six.text_type(s, encoding, errors)
 </s> add                 s = str(s, encoding, errors) </s> remove         if not issubclass(type(s), six.string_types):
 </s> add         if not issubclass(type(s), str): </s> remove         return six.text_type(s).encode(encoding, errors)
    if not isinstance(s, six.string_types):
 </s> add         return str(s).encode(encoding, errors)
    if not isinstance(s, str): </s> remove _PROTECTED_TYPES = six.integer_types + (
    type(None), float, Decimal, datetime.datetime, datetime.date, datetime.time
 </s> add _PROTECTED_TYPES = (
    type(None), int, float, Decimal, datetime.datetime, datetime.date, datetime.time,
            # Note: We use .decode() here, instead of str(s, encoding,
                  s = six.text_type(s, encoding, errors)
              else:
                  s = six.text_type(s)
          else:
            # Note: We use .decode() here, instead of str(s, encoding,
              # errors), so that if s is a SafeBytes, it ends up being a
              # SafeText at the end.
              s = s.decode(encoding, errors)
      except UnicodeDecodeError as e:
          if not isinstance(s, Exception):
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/encoding.py