              return self.range_type(value[0], value[1])
          return value
  
      def to_python(self, value):
          if isinstance(value, six.string_types):
              # Assume we're deserializing
              vals = json.loads(value)
              for end in ('lower', 'upper'):
                  if end in vals:
                      vals[end] = self.base_field.to_python(vals[end])
 
</s> remove         if isinstance(value, six.string_types):
 </s> add         if isinstance(value, str): </s> remove         if isinstance(value, six.string_types):
 </s> add         if isinstance(value, str): </s> remove             return self.delimiter.join(six.text_type(self.base_field.prepare_value(v)) for v in value)
 </s> add             return self.delimiter.join(str(self.base_field.prepare_value(v)) for v in value) </s> remove         if isinstance(value, six.string_types) or value is None:
 </s> add         if isinstance(value, str) or value is None: </s> remove         if isinstance(value, six.text_type):
            return six.memoryview(b64decode(force_bytes(value)))
 </s> add         if isinstance(value, str):
            return memoryview(b64decode(force_bytes(value)))
        if isinstance(value, str):
              return self.range_type(value[0], value[1])
          return value
  
      def to_python(self, value):
        if isinstance(value, str):
              # Assume we're deserializing
              vals = json.loads(value)
              for end in ('lower', 'upper'):
                  if end in vals:
                      vals[end] = self.base_field.to_python(vals[end])
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/postgres/fields/ranges.py