Message131162
| 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". |
|