forked from Rust-related/RustPython
14 lines
199 B
Python
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()
|