              elif json_regex.match(geo_input):
                  # Handling GeoJSON input.
                  g = wkb_r().read(gdal.OGRGeometry(geo_input).wkb)
              else:
                  raise ValueError('String or unicode input unrecognized as WKT EWKT, and HEXEWKB.')
          elif isinstance(geo_input, GEOM_PTR):
              # When the input is a pointer to a geometry (GEOM_PTR).
              g = geo_input
          elif isinstance(geo_input, six.memoryview):
              # When the input is a buffer (WKB).
 
</s> remove         if isinstance(geo_input, six.string_types):
 </s> add         if isinstance(geo_input, 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         str_instance = isinstance(geom_input, six.string_types)
 </s> add         str_instance = isinstance(geom_input, str) </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))):
                raise ValueError('String input unrecognized as WKT EWKT, and HEXEWKB.')
              elif json_regex.match(geo_input):
                  # Handling GeoJSON input.
                  g = wkb_r().read(gdal.OGRGeometry(geo_input).wkb)
              else:
                raise ValueError('String input unrecognized as WKT EWKT, and HEXEWKB.')
          elif isinstance(geo_input, GEOM_PTR):
              # When the input is a pointer to a geometry (GEOM_PTR).
              g = geo_input
          elif isinstance(geo_input, six.memoryview):
              # When the input is a buffer (WKB).
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/geos/geometry.py