mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
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()
|