          return s
      if strings_only and is_protected_type(s):
          return s
      try:
          if not issubclass(type(s), six.string_types):
              if isinstance(s, bytes):
                  s = six.text_type(s, encoding, errors)
              else:
                  s = six.text_type(s)
          else:
 
</s> remove                 s = six.text_type(s, encoding, errors)
 </s> add                 s = str(s, encoding, errors) </s> remove                 s = six.text_type(s)
 </s> add                 s = str(s) </s> remove     if isinstance(s, six.memoryview):
 </s> add     if isinstance(s, memoryview): </s> remove             # Note: We use .decode() here, instead of six.text_type(s, encoding,
 </s> add             # Note: We use .decode() here, instead of str(s, encoding, </s> remove     if issubclass(type(s), six.text_type):
 </s> add     if issubclass(type(s), str):
        if not issubclass(type(s), str):
          return s
      if strings_only and is_protected_type(s):
          return s
      try:
        if not issubclass(type(s), str):
              if isinstance(s, bytes):
                  s = six.text_type(s, encoding, errors)
              else:
                  s = six.text_type(s)
          else:
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