summaryrefslogtreecommitdiff
path: root/django/db/models/fields/files.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/fields/files.py')
-rw-r--r--django/db/models/fields/files.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
index b0dce381a6..d3f1327315 100644
--- a/django/db/models/fields/files.py
+++ b/django/db/models/fields/files.py
@@ -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