          other OGRGeomType, the short-hand string, or the integer.
          """
          if isinstance(other, OGRGeomType):
              return self.num == other.num
          elif isinstance(other, six.string_types):
              return self.name.lower() == other.lower()
          elif isinstance(other, int):
              return self.num == other
          else:
              return False
 
</s> remove         if isinstance(other, six.string_types):
 </s> add         if 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         elif f.geom_type == 'RASTER' and isinstance(value, six.string_types):
 </s> add         elif f.geom_type == 'RASTER' and isinstance(value, 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): </s> remove         if isinstance(connection, six.string_types):
 </s> add         if isinstance(connection, str):
        elif isinstance(other, str):
          other OGRGeomType, the short-hand string, or the integer.
          """
          if isinstance(other, OGRGeomType):
              return self.num == other.num
        elif isinstance(other, str):
              return self.name.lower() == other.lower()
          elif isinstance(other, int):
              return self.num == other
          else:
              return False
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/gdal/geomtype.py