          if isinstance(obj, Geometry):
              pass
          else:
              # Check if input is a candidate for conversion to raster or geometry.
              is_candidate = isinstance(obj, (bytes, six.string_types)) or hasattr(obj, '__geo_interface__')
              # Try to convert the input to raster.
              raster = self.get_raster_prep_value(obj, is_candidate)
  
              if raster:
                  obj = raster
 
</s> remove         if isinstance(ds_input, six.string_types):
 </s> add         if isinstance(ds_input, 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                 raise ValueError('String or unicode input unrecognized as WKT EWKT, and HEXEWKB.')
 </s> add                 raise ValueError('String input unrecognized as WKT EWKT, and HEXEWKB.') </s> remove         if isinstance(file, six.string_types) or file is None:
 </s> add         if isinstance(file, str) or file is None: </s> remove         str_instance = isinstance(geom_input, six.string_types)
 </s> add         str_instance = isinstance(geom_input, str)
            is_candidate = isinstance(obj, (bytes, str)) or hasattr(obj, '__geo_interface__')
          if isinstance(obj, Geometry):
              pass
          else:
              # Check if input is a candidate for conversion to raster or geometry.
            is_candidate = isinstance(obj, (bytes, str)) or hasattr(obj, '__geo_interface__')
              # Try to convert the input to raster.
              raster = self.get_raster_prep_value(obj, is_candidate)
  
              if raster:
                  obj = raster
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/fields.py