Kaydet (Commit) ae759588 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed #5501 -- Fixed Python 2.3 and 2.4 incompatibility. Thanks, brosner.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst d0f4e52a
...@@ -31,11 +31,12 @@ class SessionStore(SessionBase): ...@@ -31,11 +31,12 @@ class SessionStore(SessionBase):
try: try:
session_file = open(self._key_to_file(), "rb") session_file = open(self._key_to_file(), "rb")
try: try:
session_data = self.decode(session_file.read()) try:
except(EOFError, SuspiciousOperation): session_data = self.decode(session_file.read())
self._session_key = self._get_new_session_key() except(EOFError, SuspiciousOperation):
self._session_cache = {} self._session_key = self._get_new_session_key()
self.save() self._session_cache = {}
self.save()
finally: finally:
session_file.close() session_file.close()
except(IOError): except(IOError):
...@@ -64,4 +65,4 @@ class SessionStore(SessionBase): ...@@ -64,4 +65,4 @@ class SessionStore(SessionBase):
pass pass
def clean(self): def clean(self):
pass pass
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment