STFU those exceptions (explicitly)
Project description
Silence chosen exceptions.
Author: João Bernardo Oliveira - @jbvsmo
Replacement for the idiom:
>>> try: ... may_raise_exception() ... except Exception: ... pass
Just write:
>>> with stfu: ... may_raise_exception()
>>> with stfu(TypeError, ValueError): ... may_raise_exception()
To catch everything (even KeyboardInterrup and StopIteration):
>>> with stfu_all: ... may_raise_any_exception()
- “Errors should never pass silently.
Unless explicitly silenced.” :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
stfu-1.2.zip
(1.9 kB
view hashes)
stfu-1.2.tar.gz
(1.3 kB
view hashes)