          """
          # The geographic type of the field.
          gtype = self._field.geom_type
  
          if gtype == 'RASTER' and (value is None or isinstance(value, six.string_types + (dict, self._klass))):
              # For raster fields, assure input is None or a string, dict, or
              # raster instance.
              pass
          elif isinstance(value, self._klass) and (str(value.geom_type).upper() == gtype or gtype == 'GEOMETRY'):
              # The geometry type must match that of the field -- unless the
 
</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 value is None or isinstance(value, six.string_types + (six.memoryview,)):
 </s> add         elif value is None or isinstance(value, (str, memoryview)): </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             is_candidate = isinstance(obj, (bytes, six.string_types)) or hasattr(obj, '__geo_interface__')
 </s> add             is_candidate = isinstance(obj, (bytes, str)) or hasattr(obj, '__geo_interface__') </s> remove     if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
 </s> add     if isinstance(value, str):  # Handle strings first for performance reasons.
        if gtype == 'RASTER' and (value is None or isinstance(value, (str, dict, self._klass))):
          """
          # The geographic type of the field.
          gtype = self._field.geom_type
  
        if gtype == 'RASTER' and (value is None or isinstance(value, (str, dict, self._klass))):
              # For raster fields, assure input is None or a string, dict, or
              # raster instance.
              pass
          elif isinstance(value, self._klass) and (str(value.geom_type).upper() == gtype or gtype == 'GEOMETRY'):
              # The geometry type must match that of the field -- unless the
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/db/models/proxy.py