mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
python 3 compat
This commit is contained in:
parent
0b6107c31e
commit
7308e34c2e
|
@ -196,14 +196,14 @@ class APISettings(object):
|
|||
default = self.defaults[attr]
|
||||
if issubclass(val.__class__, Iterable) \
|
||||
and (not issubclass(default.__class__, Iterable)
|
||||
or isinstance(val, basestring)):
|
||||
or isinstance(val, six.string_types)):
|
||||
warnings.warn(
|
||||
"The `{attr}` setting must be iterable".format(**locals()),
|
||||
RESTFrameworkSettingHasUnexpectedClassWarning,
|
||||
stacklevel=3
|
||||
)
|
||||
elif isinstance(default, basestring) and not \
|
||||
isinstance(val, basestring):
|
||||
elif isinstance(default, six.string_types) and not \
|
||||
isinstance(val, six.string_types):
|
||||
warnings.warn(
|
||||
"The `{attr}` setting must be a string".format(**locals()),
|
||||
RESTFrameworkSettingHasUnexpectedClassWarning,
|
||||
|
|
Loading…
Reference in New Issue
Block a user