From 9f0cec20d584e40ae03728a1d3072e00a66fea1c Mon Sep 17 00:00:00 2001 From: Allan Saddi Date: Wed, 13 Dec 2006 16:24:01 +0000 Subject: Fix problem in session.py seen when optimization is on. --- ChangeLog | 4 ++++ flup/middleware/session.py | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 256f576..c6b467c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-12-13 Allan Saddi + + * Fix problem in session.py seen when optimization is on. + 2006-12-05 Allan Saddi * Update servers to default to an empty QUERY_STRING if diff --git a/flup/middleware/session.py b/flup/middleware/session.py index c4396fe..3c67422 100644 --- a/flup/middleware/session.py +++ b/flup/middleware/session.py @@ -652,7 +652,7 @@ class SessionService(object): # Public API def _get_session(self): - assert not self._closed + if __debug__: assert not self._closed if self._session is None: self._session = self._store.createSession() self._newSession = True @@ -664,20 +664,20 @@ class SessionService(object): 'client') def _get_hasSession(self): - assert not self._closed + if __debug__: assert not self._closed return self._session is not None hasSession = property(_get_hasSession, None, None, 'True if a Session currently exists for this client') def _get_isSessionNew(self): - assert not self._closed + if __debug__: assert not self._closed return self._newSession isSessionNew = property(_get_isSessionNew, None, None, 'True if the Session was created in this ' 'transaction') def _get_hasSessionExpired(self): - assert not self._closed + if __debug__: assert not self._closed return self._expired hasSessionExpired = property(_get_hasSessionExpired, None, None, 'True if the client was associated with a ' @@ -687,7 +687,7 @@ class SessionService(object): def encodeURL(self, url): """Encodes session ID in URL, if necessary.""" - assert not self._closed + if __debug__: assert not self._closed if not self.encodesSessionInURL or self._session is None: return url u = list(urlparse.urlsplit(url)) -- cgit v1.2.1