mirror of
https://github.com/django/django.git
synced 2025-12-05 09:33:25 +00:00
[py3] Replaced basestring by six.string_types.
This commit is contained in:
parent
cacd845996
commit
3cb2457f46
73 changed files with 230 additions and 150 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue