  def _lazy_re_compile(regex, flags=0):
      """Lazily compile a regex with flags."""
      def _compile():
          # Compile the regex if it was not passed pre-compiled.
          if isinstance(regex, six.string_types):
              return re.compile(regex, flags)
          else:
              assert not flags, "flags must be empty if regex is passed pre-compiled"
              return regex
      return SimpleLazyObject(_compile)
 
</s> remove         if isinstance(instance._regex, six.string_types):
 </s> add         if isinstance(instance._regex, str): </s> remove         if self.flags and not isinstance(self.regex, six.string_types):
 </s> add         if self.flags and not isinstance(self.regex, str): </s> remove     if isinstance(pattern, six.string_types):
 </s> add     if isinstance(pattern, str): </s> remove         elif isinstance(unique, six.string_types):
 </s> add         elif isinstance(unique, str): </s> remove         if not isinstance(query, six.string_types):
 </s> add         if not isinstance(query, str):
        if isinstance(regex, str):
  def _lazy_re_compile(regex, flags=0):
      """Lazily compile a regex with flags."""
      def _compile():
          # Compile the regex if it was not passed pre-compiled.
        if isinstance(regex, str):
              return re.compile(regex, flags)
          else:
              assert not flags, "flags must be empty if regex is passed pre-compiled"
              return regex
      return SimpleLazyObject(_compile)
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/core/validators.py