[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

@ -9,6 +9,7 @@ from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
from django.utils.encoding import force_unicode, smart_str
from django.utils import six
from django.utils.translation import ugettext_lazy as _
class FieldFile(File):
@ -176,7 +177,7 @@ class FileDescriptor(object):
# subclasses might also want to subclass the attribute class]. This
# object understands how to convert a path to a file, and also how to
# handle None.
if isinstance(file, basestring) or file is None:
if isinstance(file, six.string_types) or file is None:
attr = self.field.attr_class(instance, self.field, file)
instance.__dict__[self.field.name] = attr