Ticket #5501: r6333_fix_py24.diff

File r6333_fix_py24.diff, 971 bytes (added by brosner, 8 years ago)
  • django/contrib/sessions/backends/file.py

    === django/contrib/sessions/backends/file.py
    ==================================================================
     
    3131        try:
    3232            session_file = open(self._key_to_file(), "rb")
    3333            try:
    34                 session_data = self.decode(session_file.read())
    35             except(EOFError, SuspiciousOperation):
    36                 self._session_key = self._get_new_session_key()
    37                 self._session_cache = {}
    38                 self.save()
     34                try:
     35                    session_data = self.decode(session_file.read())
     36                except(EOFError, SuspiciousOperation):
     37                    self._session_key = self._get_new_session_key()
     38                    self._session_cache = {}
     39                    self.save()
    3940            finally:
    4041                session_file.close()
    4142        except(IOError):
Back to Top