pydu/docs/exception.rst

16 lines
327 B
ReStructuredText

Exception
---------
Utils for handling exceptions.
.. 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()
...
>>>