          constructor.
          """
          if isinstance(value, SpatialReference):
              srs = value
          elif isinstance(value, six.integer_types + six.string_types):
              srs = SpatialReference(value)
          else:
              raise ValueError('Could not create a SpatialReference from input.')
          capi.set_ds_projection_ref(self._ptr, srs.wkt.encode())
          self._flush()
 
</s> remove         elif isinstance(srs, six.integer_types + six.string_types):
 </s> add         elif isinstance(srs, (int, str)): </s> remove         return six.text_type(value)
    elif isinstance(value, (decimal.Decimal, float) + six.integer_types):
 </s> add         return str(value)
    elif isinstance(value, (decimal.Decimal, float, int)): </s> remove     elif isinstance(value, six.integer_types + (decimal.Decimal, float)):
 </s> add     elif isinstance(value, (int, decimal.Decimal, float)): </s> remove         elif isinstance(coord_trans, six.integer_types + six.string_types):
 </s> add         elif isinstance(coord_trans, (int, 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):
        elif isinstance(value, (int, str)):
          constructor.
          """
          if isinstance(value, SpatialReference):
              srs = value
        elif isinstance(value, (int, str)):
              srs = SpatialReference(value)
          else:
              raise ValueError('Could not create a SpatialReference from input.')
          capi.set_ds_projection_ref(self._ptr, srs.wkt.encode())
          self._flush()
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/raster/source.py