diff options
| author | José Padilla | 2015-02-17 08:39:06 -0400 |
|---|---|---|
| committer | José Padilla | 2015-02-17 08:39:06 -0400 |
| commit | 85bf127943bf896139b8980f06ac1e914c32efb4 (patch) | |
| tree | c553afd18b1601c2a98a5f4cdf5cdb6cac6f4779 | |
| parent | dbd23521656b366cbaa1382a0d222f8fe4e3a326 (diff) | |
| parent | c5eb5b22018e55bffe080bb3f14e34ab6b493073 (diff) | |
| download | django-rest-framework-85bf127943bf896139b8980f06ac1e914c32efb4.tar.bz2 | |
Merge pull request #2567 from carltongibson/18-warning
Move `importlib` fallback into compat.
| -rw-r--r-- | rest_framework/compat.py | 5 | ||||
| -rw-r--r-- | rest_framework/settings.py | 6 |
2 files changed, 5 insertions, 6 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 diff --git a/rest_framework/settings.py b/rest_framework/settings.py index 8ccfd3ed..394b1262 100644 --- a/rest_framework/settings.py +++ b/rest_framework/settings.py @@ -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) |
