Commit 3c053b27 authored by 's avatar

- removed obsolete upgradeException calls (there are no string exceptions in Python 2.6)

- no need to re-raise Redirect in raise_standardErrorMessage (ZPublisherExceptionHook is responsible for that)
parent 7ed69d8a
...@@ -48,7 +48,6 @@ from ExtensionClass import Base ...@@ -48,7 +48,6 @@ from ExtensionClass import Base
from Persistence import Persistent from Persistence import Persistent
from webdav.Resource import Resource from webdav.Resource import Resource
from zExceptions import Redirect from zExceptions import Redirect
from zExceptions import upgradeException
from zExceptions.ExceptionFormatter import format_exception from zExceptions.ExceptionFormatter import format_exception
from zope.interface import implements from zope.interface import implements
...@@ -197,25 +196,15 @@ class Item(Base, ...@@ -197,25 +196,15 @@ class Item(Base,
elif type(tb) is type('') and not error_tb: elif type(tb) is type('') and not error_tb:
error_tb = tb error_tb = tb
# warn if error_type is a string
error_name = 'Unknown'
if isinstance(error_type, basestring):
# String Exceptions are deprecated on Python 2.5 and
# plain won't work at all on Python 2.6. So try to upgrade it
# to a real exception.
error_name = error_type
error_type, error_value = upgradeException(error_type, error_value)
else:
if hasattr(error_type, '__name__'):
error_name = error_type.__name__
if hasattr(self, '_v_eek'): if hasattr(self, '_v_eek'):
# Stop if there is recursion. # Stop if there is recursion.
raise error_type, error_value, tb raise error_type, error_value, tb
self._v_eek = 1 self._v_eek = 1
if error_name.lower() in ('redirect',): if hasattr(error_type, '__name__'):
raise error_type, error_value, tb error_name = error_type.__name__
else:
error_name = 'Unknown'
if not error_message: if not error_message:
try: try:
......
...@@ -27,7 +27,6 @@ from Acquisition import aq_parent ...@@ -27,7 +27,6 @@ from Acquisition import aq_parent
from Acquisition.interfaces import IAcquirer from Acquisition.interfaces import IAcquirer
from App.config import getConfiguration from App.config import getConfiguration
from time import asctime from time import asctime
from zExceptions import upgradeException
from zExceptions import Redirect from zExceptions import Redirect
from zExceptions import Unauthorized from zExceptions import Unauthorized
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
...@@ -181,8 +180,6 @@ class ZPublisherExceptionHook: ...@@ -181,8 +180,6 @@ class ZPublisherExceptionHook:
def __call__(self, published, REQUEST, t, v, traceback): def __call__(self, published, REQUEST, t, v, traceback):
try: try:
t, v = upgradeException(t, v)
if t is SystemExit or issubclass(t, Redirect): if t is SystemExit or issubclass(t, Redirect):
raise t, v, traceback raise t, v, traceback
......
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