mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
Merge pull request #2567 from carltongibson/18-warning
Move `importlib` fallback into compat.
This commit is contained in:
commit
85bf127943
|
@ -12,7 +12,10 @@ from django.utils.six.moves.urllib.parse import urlparse as _urlparse
|
|||
from django.utils import six
|
||||
import django
|
||||
import inspect
|
||||
|
||||
try:
|
||||
import importlib
|
||||
except ImportError:
|
||||
from django.utils import importlib
|
||||
|
||||
def unicode_repr(instance):
|
||||
# Get the repr of an instance, but ensure it is a unicode string
|
||||
|
|
|
@ -20,13 +20,9 @@ back to the defaults.
|
|||
from __future__ import unicode_literals
|
||||
from django.test.signals import setting_changed
|
||||
from django.conf import settings
|
||||
try:
|
||||
import importlib
|
||||
except ImportError:
|
||||
from django.utils import importlib
|
||||
from django.utils import six
|
||||
from rest_framework import ISO_8601
|
||||
|
||||
from rest_framework.compat import importlib
|
||||
|
||||
USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK', None)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user