Message169342
| Author |
rhettinger |
| Recipients |
alex, ncoghlan, rhettinger |
| Date |
2012年08月29日.06:06:15 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1346220375.94.0.150495606189.issue15806@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Yes, something along those lines would be *much* better:
class Ignore:
''' Context manager to ignore particular exceptions'''
def __init__(self, *ignored_exceptions):
self.ignored_exceptions = ignored_exceptions
def __enter__(self):
return self
def __exit__(self, exctype, excinst, exctb):
return exctype and issubclass(exctype, self.ignored_exceptions) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年08月29日 06:06:15 | rhettinger | set | recipients:
+ rhettinger, ncoghlan, alex |
| 2012年08月29日 06:06:15 | rhettinger | set | messageid: <1346220375.94.0.150495606189.issue15806@psf.upfronthosting.co.za> |
| 2012年08月29日 06:06:15 | rhettinger | link | issue15806 messages |
| 2012年08月29日 06:06:15 | rhettinger | create |
|