Setting: Improve type checking

Update the type checking from using Django's six port
to use direct list and tuple instance checking.

Needed for Python 3.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-12-05 04:43:47 -04:00
parent 8aeb7f01fe
commit c430d471e6

View File

@@ -10,7 +10,6 @@ import yaml
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.utils import six
from django.utils.functional import Promise from django.utils.functional import Promise
from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.encoding import force_text, python_2_unicode_compatible
@@ -84,7 +83,7 @@ class Setting(object):
""" """
Walk all the elements of a value and force promises to text Walk all the elements of a value and force promises to text
""" """
if isinstance(value, (six.types.ListType, six.types.TupleType)): if isinstance(value, (list, tuple)):
return [Setting.express_promises(item) for item in value] return [Setting.express_promises(item) for item in value]
elif isinstance(value, Promise): elif isinstance(value, Promise):
return force_text(value) return force_text(value)