      Helper routine for `ogrinspect` that generates GeoDjango models corresponding
      to the given data source.  See the `ogrinspect` docstring for more details.
      """
      # Getting the DataSource
      if isinstance(data_source, six.string_types):
          data_source = DataSource(data_source)
      elif isinstance(data_source, DataSource):
          pass
      else:
          raise TypeError('Data source parameter must be a string or a DataSource object.')
 
</s> remove     if isinstance(data_source, six.string_types):
 </s> add     if isinstance(data_source, str): </s> remove         if isinstance(data, six.string_types):
 </s> add         if isinstance(data, str): </s> remove         if not isinstance(query, six.string_types):
 </s> add         if not isinstance(query, str): </s> remove         if isinstance(dr_input, six.string_types):
 </s> add         if isinstance(dr_input, str): </s> remove         if isinstance(ds_input, six.string_types):
 </s> add         if isinstance(ds_input, str):
    if isinstance(data_source, str):
      Helper routine for `ogrinspect` that generates GeoDjango models corresponding
      to the given data source.  See the `ogrinspect` docstring for more details.
      """
      # Getting the DataSource
    if isinstance(data_source, str):
          data_source = DataSource(data_source)
      elif isinstance(data_source, DataSource):
          pass
      else:
          raise TypeError('Data source parameter must be a string or a DataSource object.')
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/utils/ogrinspect.py