Commit 04332818 authored by Hanno Schlichting's avatar Hanno Schlichting

Use Python's current `raise` syntax

parent 92e41a53
...@@ -105,8 +105,8 @@ class Application(ApplicationDefaultPermissions, ...@@ -105,8 +105,8 @@ class Application(ApplicationDefaultPermissions,
def Redirect(self, destination, URL1): def Redirect(self, destination, URL1):
"""Utility function to allow user-controlled redirects""" """Utility function to allow user-controlled redirects"""
if destination.find('//') >= 0: if destination.find('//') >= 0:
raise RedirectException, destination raise RedirectException(destination)
raise RedirectException, ("%s/%s" % (URL1, destination)) raise RedirectException("%s/%s" % (URL1, destination))
ZopeRedirect = Redirect ZopeRedirect = Redirect
...@@ -132,7 +132,7 @@ class Application(ApplicationDefaultPermissions, ...@@ -132,7 +132,7 @@ class Application(ApplicationDefaultPermissions,
try: try:
REQUEST.RESPONSE.notFoundError("%s\n%s" % (name, method)) REQUEST.RESPONSE.notFoundError("%s\n%s" % (name, method))
except AttributeError: except AttributeError:
raise KeyError, name raise KeyError(name)
def ZopeTime(self, *args): def ZopeTime(self, *args):
"""Utility function to return current date/time""" """Utility function to return current date/time"""
...@@ -141,12 +141,12 @@ class Application(ApplicationDefaultPermissions, ...@@ -141,12 +141,12 @@ class Application(ApplicationDefaultPermissions,
def DELETE(self, REQUEST, RESPONSE): def DELETE(self, REQUEST, RESPONSE):
"""Delete a resource object.""" """Delete a resource object."""
self.dav__init(REQUEST, RESPONSE) self.dav__init(REQUEST, RESPONSE)
raise Forbidden, 'This resource cannot be deleted.' raise Forbidden('This resource cannot be deleted.')
def MOVE(self, REQUEST, RESPONSE): def MOVE(self, REQUEST, RESPONSE):
"""Move a resource to a new location.""" """Move a resource to a new location."""
self.dav__init(REQUEST, RESPONSE) 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): def absolute_url(self, relative=0):
"""The absolute URL of the root object is BASE1 or "/". """The absolute URL of the root object is BASE1 or "/".
......
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