mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
14 lines
282 B
Python
Vendored
14 lines
282 B
Python
Vendored
import contextlib
|
|
|
|
|
|
# from jaraco.context 4.3
|
|
class suppress(contextlib.suppress, contextlib.ContextDecorator):
|
|
"""
|
|
A version of contextlib.suppress with decorator support.
|
|
|
|
>>> @suppress(KeyError)
|
|
... def key_error():
|
|
... {}['']
|
|
>>> key_error()
|
|
"""
|