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
This commit is contained in:
Jannis Leidel 2012-03-23 09:32:11 +00:00
parent 2ca9801956
commit 46871eb1bb
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ from django.core.cache import cache
KEY_PREFIX = "django.contrib.sessions.cache" KEY_PREFIX = "django.contrib.sessions.cache"
class SessionStore(SessionBase): class SessionStore(SessionBase):
""" """
A cache-based session store. A cache-based session store.
@ -18,7 +19,7 @@ class SessionStore(SessionBase):
def load(self): def load(self):
try: try:
session_data = self._cache.get(self.cache_key, None) session_data = self._cache.get(self.cache_key, None)
except Exception as e: except Exception, e:
e_type = str(type(e)) e_type = str(type(e))
if e_type != "<class 'memcache.MemcachedKeyLengthError'>": if e_type != "<class 'memcache.MemcachedKeyLengthError'>":
raise e raise e

View File

@ -8,6 +8,7 @@ from django.core.cache import cache
KEY_PREFIX = "django.contrib.sessions.cached_db" KEY_PREFIX = "django.contrib.sessions.cached_db"
class SessionStore(DBStore): class SessionStore(DBStore):
""" """
Implements cached, database backed sessions. Implements cached, database backed sessions.
@ -23,7 +24,7 @@ class SessionStore(DBStore):
def load(self): def load(self):
try: try:
data = cache.get(self.cache_key, None) data = cache.get(self.cache_key, None)
except Exception as e: except Exception, e:
e_type = str(type(e)) e_type = str(type(e))
if e_type != "<class 'memcache.MemcachedKeyLengthError'>": if e_type != "<class 'memcache.MemcachedKeyLengthError'>":
raise e raise e