In article <87ljqnpo6o....@benfinney.id.au>,
Ben Finney  <ben+pyt...@benfinney.id.au> wrote:
>
>What I need is to “wrap” the exception caught such that it has a
>different type and message. But I don't want to lose the existing
>type, message, and stack trace; that's all useful information for
>someone trying to debug the problem.
>
>Python's PEP 3134 “Exception Chaining and Embedded Tracebacks”
>discusses a change accepted in Python 3.0 for “chaining” exception
>objects, to indicate that a new exception was raised during the
>handling of an existing exception.
>
>What I'm trying to do is related: I need it working in earlier Python
>versions, and I need it not for chaining, but only for polymorphism.
>What is the right way to do this?

The same way that 3.0 does it, IMO.
-- 
Aahz (a...@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"...string iteration isn't about treating strings as sequences of strings, 
it's about treating strings as sequences of characters.  The fact that
characters are also strings is the reason we have problems, but characters 
are strings for other good reasons."  --Aahz
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to