mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 13:30: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]
|
default = self.defaults[attr]
|
||||||
if issubclass(val.__class__, Iterable) \
|
if issubclass(val.__class__, Iterable) \
|
||||||
and (not issubclass(default.__class__, Iterable)
|
and (not issubclass(default.__class__, Iterable)
|
||||||
or isinstance(val, basestring)):
|
or isinstance(val, six.string_types)):
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"The `{attr}` setting must be iterable".format(**locals()),
|
"The `{attr}` setting must be iterable".format(**locals()),
|
||||||
RESTFrameworkSettingHasUnexpectedClassWarning,
|
RESTFrameworkSettingHasUnexpectedClassWarning,
|
||||||
stacklevel=3
|
stacklevel=3
|
||||||
)
|
)
|
||||||
elif isinstance(default, basestring) and not \
|
elif isinstance(default, six.string_types) and not \
|
||||||
isinstance(val, basestring):
|
isinstance(val, six.string_types):
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"The `{attr}` setting must be a string".format(**locals()),
|
"The `{attr}` setting must be a string".format(**locals()),
|
||||||
RESTFrameworkSettingHasUnexpectedClassWarning,
|
RESTFrameworkSettingHasUnexpectedClassWarning,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user