summaryrefslogtreecommitdiff
path: root/django/contrib/comments/views/utils.py
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/contrib/comments/views/utils.py
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/contrib/comments/views/utils.py')
-rw-r--r--django/contrib/comments/views/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/contrib/comments/views/utils.py b/django/contrib/comments/views/utils.py
index 8879e9fb8f..abaed68560 100644
--- a/django/contrib/comments/views/utils.py
+++ b/django/contrib/comments/views/utils.py
@@ -2,8 +2,12 @@
A few bits of helper functions for comment views.
"""
-import urllib
import textwrap
+try:
+ from urllib.parse import urlencode
+except ImportError: # Python 2
+ from urllib import urlencode
+
from django.http import HttpResponseRedirect
from django.core import urlresolvers
from django.shortcuts import render_to_response
@@ -33,7 +37,7 @@ def next_redirect(data, default, default_view, **get_kwargs):
anchor = ''
joiner = ('?' in next) and '&' or '?'
- next += joiner + urllib.urlencode(get_kwargs) + anchor
+ next += joiner + urlencode(get_kwargs) + anchor
return HttpResponseRedirect(next)
def confirmation_view(template, doc="Display a confirmation view."):