def no_interrupt(syscall, *args, **kwargs):
 ret = None
 while True:
  try:
   ret = syscall(*args, **kwargs)
  except OSError as e:
   if (e.errno == errno.EINTR):
    continue
   else:
    raise
  else:
   break
 return ret

def no_interrupt ( syscall , * args , ** kwargs ) : ret = None while True : try : ret = syscall ( * args , ** kwargs ) except OSError as e : if ( e . errno == errno . EINTR ) : continue else : raise else : break return ret
a helper for making system calls immune to eintr .