From c5eb5b22018e55bffe080bb3f14e34ab6b493073 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 17 Feb 2015 11:55:15 +0100 Subject: Move `importlib` fallback into compat. --- rest_framework/compat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rest_framework/compat.py') 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 -- cgit v1.2.3