[Zope-Checkins] SVN: Zope/trunk/src/OFS/Application.py Use Python's current `raise` syntax

Hanno Schlichting hannosch at hannosch.eu
Sun Jul 3 12:24:43 EDT 2011


Log message for revision 122098:
  Use Python's current `raise` syntax
  

Changed:
  U   Zope/trunk/src/OFS/Application.py

-=-
Modified: Zope/trunk/src/OFS/Application.py
===================================================================
--- Zope/trunk/src/OFS/Application.py	2011-07-03 16:22:35 UTC (rev 122097)
+++ Zope/trunk/src/OFS/Application.py	2011-07-03 16:24:42 UTC (rev 122098)
@@ -105,8 +105,8 @@
     def Redirect(self, destination, URL1):
         """Utility function to allow user-controlled redirects"""
         if destination.find('//') >= 0:
-            raise RedirectException, destination
-        raise RedirectException, ("%s/%s" % (URL1, destination))
+            raise RedirectException(destination)
+        raise RedirectException("%s/%s" % (URL1, destination))
 
     ZopeRedirect = Redirect
 
@@ -132,7 +132,7 @@
         try:
             REQUEST.RESPONSE.notFoundError("%s\n%s" % (name, method))
         except AttributeError:
-            raise KeyError, name
+            raise KeyError(name)
 
     def ZopeTime(self, *args):
         """Utility function to return current date/time"""
@@ -141,12 +141,12 @@
     def DELETE(self, REQUEST, RESPONSE):
         """Delete a resource object."""
         self.dav__init(REQUEST, RESPONSE)
-        raise Forbidden, 'This resource cannot be deleted.'
+        raise Forbidden('This resource cannot be deleted.')
 
     def MOVE(self, REQUEST, RESPONSE):
         """Move a resource to a new location."""
         self.dav__init(REQUEST, RESPONSE)
-        raise Forbidden, 'This resource cannot be moved.'
+        raise Forbidden('This resource cannot be moved.')
 
     def absolute_url(self, relative=0):
         """The absolute URL of the root object is BASE1 or "/".



More information about the Zope-Checkins mailing list