pydu/docs/exception.rst

14 lines
295 B
ReStructuredText
Raw Normal View History

2017-12-17 10:08:55 +00:00
Exception
---------
.. py:function:: pydu.exception.ignore(*exceptions)
A context manager which can ignore given exceptions.
>>> from pydu.exception import ignore
>>> with ignore(ValueError, AttributeError):
... int('abc')
... int.no_exists_func()
...
>>>