mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
	
		
			282 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
	
		
			282 B
		
	
	
	
		
			Python
		
	
	
	
	
	
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()
 | 
						|
    """
 |