@contextmanager
def ignore_errno(*errnos, **kwargs):
 types = (kwargs.get(u'types') or (Exception,))
 errnos = [get_errno_name(errno) for errno in errnos]
 try:
  (yield)
 except types as exc:
  if (not hasattr(exc, u'errno')):
   raise
  if (exc.errno not in errnos):
   raise

@ contextmanager def ignore_errno ( * errnos , ** kwargs ) : types = ( kwargs . get ( u'types' ) or ( Exception , ) ) errnos = [ get_errno_name ( errno ) for errno in errnos ] try : ( yield ) except types as exc : if ( not hasattr ( exc , u'errno' ) ) : raise if ( exc . errno not in errnos ) : raise
context manager to ignore specific posix error codes .