Files
RustPython/benches/microbenchmarks/exception_context.py
2020-12-13 17:06:21 +00:00

14 lines
199 B
Python

from contextlib import contextmanager
@contextmanager
def try_catch(*args, **kwargs):
try:
yield
except RuntimeError:
pass
# ---
with try_catch():
raise RuntimeError()