diff options
| author | Jannis Leidel <jannis@leidel.info> | 2012-03-23 09:32:11 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2012-03-23 09:32:11 +0000 |
| commit | 46871eb1bb37e0c34f4498e671f6418f9487d69f (patch) | |
| tree | 5a8c3ae4997e423e2af2b27aa02ec4f715ca8142 | |
| parent | 2ca980195653a754a1c4726f5bb253147c6cb329 (diff) | |
Fixed an incompatibility with Python 2.5 in the changes done in r17795. Refs #17810.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17796 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/sessions/backends/cache.py | 3 | ||||
| -rw-r--r-- | django/contrib/sessions/backends/cached_db.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/django/contrib/sessions/backends/cache.py b/django/contrib/sessions/backends/cache.py index ac6647e110..7c3eecd425 100644 --- a/django/contrib/sessions/backends/cache.py +++ b/django/contrib/sessions/backends/cache.py @@ -3,6 +3,7 @@ from django.core.cache import cache KEY_PREFIX = "django.contrib.sessions.cache" + class SessionStore(SessionBase): """ A cache-based session store. @@ -18,7 +19,7 @@ class SessionStore(SessionBase): def load(self): try: session_data = self._cache.get(self.cache_key, None) - except Exception as e: + except Exception, e: e_type = str(type(e)) if e_type != "<class 'memcache.MemcachedKeyLengthError'>": raise e diff --git a/django/contrib/sessions/backends/cached_db.py b/django/contrib/sessions/backends/cached_db.py index 20804c85f6..db0d3515b1 100644 --- a/django/contrib/sessions/backends/cached_db.py +++ b/django/contrib/sessions/backends/cached_db.py @@ -8,6 +8,7 @@ from django.core.cache import cache KEY_PREFIX = "django.contrib.sessions.cached_db" + class SessionStore(DBStore): """ Implements cached, database backed sessions. @@ -23,7 +24,7 @@ class SessionStore(DBStore): def load(self): try: data = cache.get(self.cache_key, None) - except Exception as e: + except Exception, e: e_type = str(type(e)) if e_type != "<class 'memcache.MemcachedKeyLengthError'>": raise e |
