[CMF-checkins] CVS: CMF/CMFCore - CookieCrumbler.py:1.18.10.3

Shane Hathaway shane at zope.com
Thu Jan 22 11:42:27 EST 2004


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv309

Modified Files:
      Tag: CMF-1_4-branch
	CookieCrumbler.py 
Log Message:
Made compatible with Zope 2.7: raise Redirect instances rather than strings.


=== CMF/CMFCore/CookieCrumbler.py 1.18.10.2 => 1.18.10.3 ===
--- CMF/CMFCore/CookieCrumbler.py:1.18.10.2	Thu Dec  4 16:58:14 2003
+++ CMF/CMFCore/CookieCrumbler.py	Thu Jan 22 11:42:26 2004
@@ -36,6 +36,12 @@
 ATTEMPT_LOGIN = 1      # Attempt to log in
 ATTEMPT_RESUME = 2     # Attempt to resume session
 
+try:
+    from zExceptions import Redirect
+except ImportError:
+    # Pre Zope 2.7
+    Redirect = 'Redirect'
+
 
 class CookieCrumbler (SimpleItemWithProperties):
     '''
@@ -198,7 +204,7 @@
         # Redirect if desired.
         url = self.getLoginURL()
         if url is not None:
-            raise 'Redirect', url
+            raise Redirect, url
         # Fall through to the standard unauthorized() call.
         resp.unauthorized()
 




More information about the CMF-checkins mailing list