Message145560
| Author |
eric.snow |
| Recipients |
eric.snow, ezio.melotti, rhettinger |
| Date |
2011年10月14日.20:05:13 |
| SpamBayes Score |
0.0014939841 |
| Marked as misclassified |
No |
| Message-id |
<1318622714.39.0.261065297397.issue13177@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Could you just cancel the chained exception?
>>> try: {}["asdf"]
... except KeyError:
... try: raise Exception()
... except Exception as x:
... x.__cause__ = None
... x.__context__ = None
... x.__traceback__ = None
... raise x
...
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
Exception
in contrast to:
>>> try: {}["asdf"]
... except KeyError:
... try: raise e
... except Exception as x:
... raise x
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'asdf'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "<stdin>", line 3, in <module>
File "<stdin>", line 8, in <module>
Exception |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年10月14日 20:05:14 | eric.snow | set | recipients:
+ eric.snow, rhettinger, ezio.melotti |
| 2011年10月14日 20:05:14 | eric.snow | set | messageid: <1318622714.39.0.261065297397.issue13177@psf.upfronthosting.co.za> |
| 2011年10月14日 20:05:13 | eric.snow | link | issue13177 messages |
| 2011年10月14日 20:05:13 | eric.snow | create |
|