              self.file_path = kwargs.pop('file_path')
          else:
              self.file_path = getattr(settings, 'EMAIL_FILE_PATH', None)
          # Make sure self.file_path is a string.
          if not isinstance(self.file_path, six.string_types):
              raise ImproperlyConfigured('Path for saving emails is invalid: %r' % self.file_path)
          self.file_path = os.path.abspath(self.file_path)
          # Make sure that self.file_path is an directory if it exists.
          if os.path.exists(self.file_path) and not os.path.isdir(self.file_path):
              raise ImproperlyConfigured(
 
</s> remove         if isinstance(index, six.integer_types):
 </s> add         if isinstance(index, int): </s> remove     if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
 </s> add     if isinstance(value, str):  # Handle strings first for performance reasons. </s> remove     if isinstance(result, six.integer_types):
 </s> add     if isinstance(result, int): </s> remove         if not isinstance(index, (slice,) + six.integer_types):
 </s> add         if not isinstance(index, (int, slice)): </s> remove         if self.flags and not isinstance(self.regex, six.string_types):
 </s> add         if self.flags and not isinstance(self.regex, str):
        if not isinstance(self.file_path, str):
              self.file_path = kwargs.pop('file_path')
          else:
              self.file_path = getattr(settings, 'EMAIL_FILE_PATH', None)
          # Make sure self.file_path is a string.
        if not isinstance(self.file_path, str):
              raise ImproperlyConfigured('Path for saving emails is invalid: %r' % self.file_path)
          self.file_path = os.path.abspath(self.file_path)
          # Make sure that self.file_path is an directory if it exists.
          if os.path.exists(self.file_path) and not os.path.isdir(self.file_path):
              raise ImproperlyConfigured(
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/mail/backends/filebased.py