This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mrabarnett
Recipients aronacher, draghuram, eric.araujo, ethan.furman, mrabarnett, ncoghlan, pitrou, poke, rhettinger, steven.daprano
Date 2011-03-16.19:45:44
SpamBayes Score 1.8120847e-05
Marked as misclassified No
Message-id <1300304746.07.0.787140622415.issue6210@psf.upfronthosting.co.za>
In-reply-to
Content
I've been looking through the list of current keywords and the best syntax I could come up with for suppressing the context is:

    try:
        x / y
    except ZeroDivisionError as e:
        raise as Exception( 'Invalid value for y' )

The rationale is that it's saying "forget about the original exception (if any), raise _as though_ this is the original exception".
History
Date User Action Args
2011-03-16 19:45:46mrabarnettsetrecipients: + mrabarnett, rhettinger, ncoghlan, pitrou, draghuram, aronacher, eric.araujo, steven.daprano, poke, ethan.furman
2011-03-16 19:45:46mrabarnettsetmessageid: <1300304746.07.0.787140622415.issue6210@psf.upfronthosting.co.za>
2011-03-16 19:45:44mrabarnettlinkissue6210 messages
2011-03-16 19:45:44mrabarnettcreate