Files

12 lines
302 B
Python
Raw Permalink Normal View History

2026-02-19 00:55:27 +02:00
import contextlib
def suppress_exceptions(callables, exceptions=Exception):
"""
yield the results of calling each element of callables, suppressing
any indicated exceptions.
"""
for callable in callables:
with contextlib.suppress(exceptions):
yield callable()