Commit 6be00774 authored by Luke Plant's avatar Luke Plant
Browse files

Consistent imports for parse_qsl function, avoiding the...

Consistent imports for parse_qsl function, avoiding the `PendingDeprecationWarning` under Python 2.6 and later

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 40a2a1c5
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -16,8 +16,15 @@ See docs/cache.txt for information on the public API.
"""

try:
    # The mod_python version is more efficient, so try importing it first.
    from mod_python.util import parse_qsl
except ImportError:
    try:
        # Python 2.6 and greater
        from urlparse import parse_qsl
    except ImportError:
        # Python 2.5, 2.4.  Works on Python 2.6 but raises
        # PendingDeprecationWarning
        from cgi import parse_qsl

from django.conf import settings
+7 −1
Original line number Diff line number Diff line
@@ -10,6 +10,12 @@ try:
    # The mod_python version is more efficient, so try importing it first.
    from mod_python.util import parse_qsl
except ImportError:
    try:
        # Python 2.6 and greater
        from urlparse import parse_qsl
    except ImportError:
        # Python 2.5, 2.4.  Works on Python 2.6 but raises
        # PendingDeprecationWarning
        from cgi import parse_qsl

from django.utils.datastructures import MultiValueDict, ImmutableList