mirror of
https://github.com/django/django.git
synced 2025-07-19 03:05:32 +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
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue