aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/compat.py
diff options
context:
space:
mode:
authorXavier Ordoquy2013-01-02 19:06:55 +0100
committerXavier Ordoquy2013-01-02 19:06:55 +0100
commit4b77b3c5adcc147316629a01e05a3600d1d89d27 (patch)
treea5b2f7860f8644a0d81a715f5077ecd4ea08816a /rest_framework/compat.py
parentc95fa81cb25fbdb7af3c8cc39cc45e49eff66c98 (diff)
downloaddjango-rest-framework-4b77b3c5adcc147316629a01e05a3600d1d89d27.tar.bz2
Move the urlparse lib compatibility to the compat file.
Diffstat (limited to 'rest_framework/compat.py')
-rw-r--r--rest_framework/compat.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py
index d5a9d995..42ad9e93 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -30,6 +30,13 @@ except ImportError:
from six import BytesIO
+# urlparse compat import (Required because it changed in python 3.x)
+try:
+ from urllib import parse as urlparse
+except ImportError:
+ import urlparse as urlparse
+
+
# Try to import PIL in either of the two ways it can end up installed.
try:
from PIL import Image
@@ -109,7 +116,6 @@ else:
import re
import random
import logging
- import urlparse
from django.conf import settings
from django.core.urlresolvers import get_callable