diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-10-20 13:07:06 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-10-20 13:07:06 +0000 |
| commit | 6be00774a4d65fc4d84c297ca6bd36c9c86fbca9 (patch) | |
| tree | d7ba743fcbdac51265e27a7f218750a41da502e5 /django/core/cache | |
| parent | 40a2a1c59d380e7ed3d95b6cfd287b440ff0bd3a (diff) | |
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
Diffstat (limited to 'django/core/cache')
| -rw-r--r-- | django/core/cache/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py index 41cbc76bc8..7c3f0927eb 100644 --- a/django/core/cache/__init__.py +++ b/django/core/cache/__init__.py @@ -16,9 +16,16 @@ See docs/cache.txt for information on the public API. """ try: - from urlparse import parse_qsl + # The mod_python version is more efficient, so try importing it first. + from mod_python.util import parse_qsl except ImportError: - from cgi import parse_qsl + 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 from django.core import signals |
