1import contextlib 2 3 4# from jaraco.context 4.3 5class suppress(contextlib.suppress, contextlib.ContextDecorator): 6 """ 7 A version of contextlib.suppress with decorator support. 8 9 >>> @suppress(KeyError) 10 ... def key_error(): 11 ... {}[''] 12 >>> key_error() 13 """ 14