summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-07-20 15:36:52 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-07-22 09:29:55 +0200
commit0d914d08a0d7b5a1521f498a8047971fe6cd61e7 (patch)
treed0ab08b0b5b2041bd796c10a26a358ae60d0914a /django/http
parentbdca5ea345c548a82a80d198906818c9ccbef896 (diff)
[py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases to keey it easy to identify where the functions come from.
Diffstat (limited to 'django/http')
-rw-r--r--django/http/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 7c5184a329..da97506c8c 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -10,8 +10,11 @@ import warnings
from io import BytesIO
from pprint import pformat
-from urllib import urlencode, quote
-from urlparse import urljoin, parse_qsl
+try:
+ from urllib.parse import quote, parse_qsl, urlencode, urljoin
+except ImportError: # Python 2
+ from urllib import quote, urlencode
+ from urlparse import parse_qsl, urljoin
import Cookie
# Some versions of Python 2.7 and later won't need this encoding bug fix: