aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/compat.py
diff options
context:
space:
mode:
authorCarlton Gibson2015-02-17 11:55:15 +0100
committerCarlton Gibson2015-02-17 11:55:15 +0100
commitc5eb5b22018e55bffe080bb3f14e34ab6b493073 (patch)
tree76a17d67ca9bec4d99e57d5c6540500a32beb3d3 /rest_framework/compat.py
parentdaf1d59d0f41d2ea89e0b996d22b5d4e84914fb5 (diff)
downloaddjango-rest-framework-c5eb5b22018e55bffe080bb3f14e34ab6b493073.tar.bz2
Move `importlib` fallback into compat.
Diffstat (limited to 'rest_framework/compat.py')
-rw-r--r--rest_framework/compat.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py
index 50f37014..c6a4a869 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -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