[py3] Replaced basestring by six.string_types.

This commit is contained in:
Aymeric Augustin 2012-07-20 14:22:00 +02:00
parent cacd845996
commit 3cb2457f46
73 changed files with 230 additions and 150 deletions

View file

@ -6,6 +6,7 @@ import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
from django.utils import six
class EmailBackend(ConsoleEmailBackend):
def __init__(self, *args, **kwargs):
@ -15,7 +16,7 @@ class EmailBackend(ConsoleEmailBackend):
else:
self.file_path = getattr(settings, 'EMAIL_FILE_PATH',None)
# Make sure self.file_path is a string.
if not isinstance(self.file_path, basestring):
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.