              srid = row[1]
              field_params = {}
              if srid != 4326:
                  field_params['srid'] = srid
              if (isinstance(dim, six.string_types) and 'Z' in dim) or dim == 3:
                  field_params['dim'] = 3
          finally:
              cursor.close()
  
          return field_type, field_params
 
</s> remove         if isinstance(srid, six.integer_types) or srid is None:
 </s> add         if isinstance(srid, int) or srid is None: </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 isinstance(srs_input, six.string_types):
 </s> add         elif isinstance(srs_input, str): </s> remove         elif isinstance(srs_input, six.integer_types):
 </s> add         elif isinstance(srs_input, int): </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(dim, str) and 'Z' in dim) or dim == 3:
              srid = row[1]
              field_params = {}
              if srid != 4326:
                  field_params['srid'] = srid
            if (isinstance(dim, str) and 'Z' in dim) or dim == 3:
                  field_params['dim'] = 3
          finally:
              cursor.close()
  
          return field_type, field_params
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/backends/spatialite/introspection.py