          """
          Equivalence testing, a Geometry may be compared with another Geometry
          or an EWKT representation.
          """
          if isinstance(other, six.string_types):
              if other.startswith('SRID=0;'):
                  return self.ewkt == other[7:]  # Test only WKT part of other
              return self.ewkt == other
          elif isinstance(other, GEOSGeometry):
              return self.srid == other.srid and self.equals_exact(other)
 
</s> remove         elif isinstance(other, six.string_types):
 </s> add         elif isinstance(other, str): </s> remove         if gtype == 'RASTER' and (value is None or isinstance(value, six.string_types + (dict, self._klass))):
 </s> add         if gtype == 'RASTER' and (value is None or isinstance(value, (str, dict, self._klass))): </s> remove     return line == ('\n' if isinstance(line, six.text_type) else b'\n')
 </s> add     return line == ('\n' if isinstance(line, str) else b'\n') </s> remove         if isinstance(connection, six.string_types):
 </s> add         if isinstance(connection, str): </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(other, str):
          """
          Equivalence testing, a Geometry may be compared with another Geometry
          or an EWKT representation.
          """
        if isinstance(other, str):
              if other.startswith('SRID=0;'):
                  return self.ewkt == other[7:]  # Test only WKT part of other
              return self.ewkt == other
          elif isinstance(other, GEOSGeometry):
              return self.srid == other.srid and self.equals_exact(other)
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/contrib/gis/geos/geometry.py