@contextlib.contextmanager
def check_py3k_warnings(*filters, **kwargs):
 if sys.py3kwarning:
  if (not filters):
   filters = (('', DeprecationWarning),)
 else:
  filters = ()
 return _filterwarnings(filters, kwargs.get('quiet'))

@ contextlib . contextmanager def check_py3k_warnings ( * filters , ** kwargs ) : if sys . py3kwarning : if ( not filters ) : filters = ( ( '' , DeprecationWarning ) , ) else : filters = ( ) return _filterwarnings ( filters , kwargs . get ( 'quiet' ) )
context manager to silence py3k warnings .