  def equals_lf(line):
      """
      Return True if line (a text or byte string) equals '\n'.
      """
      return line == ('\n' if isinstance(line, six.text_type) else b'\n')
 
</s> remove     return line.endswith('\n' if isinstance(line, six.text_type) else b'\n')
 </s> add     return line.endswith('\n' if isinstance(line, str) else b'\n') </s> remove     return line.endswith('\r' if isinstance(line, six.text_type) else b'\r')
 </s> add     return line.endswith('\r' if isinstance(line, str) else b'\r') </s> remove         stream_class = StringIO if isinstance(content, six.text_type) else BytesIO
 </s> add         stream_class = StringIO if isinstance(content, str) else BytesIO </s> remove         append_script = lazy(lambda string: r'<script>this</script>' + string, six.text_type)
 </s> add         append_script = lazy(lambda string: r'<script>this</script>' + string, str) </s> remove         if isinstance(other, six.string_types):
 </s> add         if isinstance(other, str):
    return line == ('\n' if isinstance(line, str) else b'\n')
  def equals_lf(line):
      """
      Return True if line (a text or byte string) equals '\n'.
      """
    return line == ('\n' if isinstance(line, str) else b'\n')
keep keep keep keep replace
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/core/files/base.py