A simple wrapper around contextlib.suppress
Project description
Suppres
Decorator to ignore exceptions in functions. A simple wrapper around contextlib.suppress.
Install
pip install suppress
Usage
from suppress import suppress
@suppress(ZeroDivisionError)
def zero_error_function():
1/0
def main():
print('First print')
zero_error_function()
print('Second print')
if __name__ == '__main__':
main()
Output:
First print
Second print
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 Distribution
suppress-0.1.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for suppress-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b57eaec8ed6832d08a42b9fe45feaf659bbdd48c418ea8c2703d402d1e97c77f |
|
MD5 | c7c6fd5cf0d5cae8de35011ae53c5ce5 |
|
BLAKE2b-256 | ef9bc8af8159eaf23015857a3d77217f0f8e161ed64b0d08496c119ac8b05c93 |