Message131162
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". |
|
Date |
User |
Action |
Args |
2011-03-16 19:45:46 | mrabarnett | set | recipients:
+ mrabarnett, rhettinger, ncoghlan, pitrou, draghuram, aronacher, eric.araujo, steven.daprano, poke, ethan.furman |
2011-03-16 19:45:46 | mrabarnett | set | messageid: <1300304746.07.0.787140622415.issue6210@psf.upfronthosting.co.za> |
2011-03-16 19:45:44 | mrabarnett | link | issue6210 messages |
2011-03-16 19:45:44 | mrabarnett | create | |
|