def retry_on_signal(function):
 while True:
  try:
   return function()
  except EnvironmentError as e:
   if (e.errno != errno.EINTR):
    raise

def retry_on_signal ( function ) : while True : try : return function ( ) except EnvironmentError as e : if ( e . errno != errno . EINTR ) : raise
retries function until it doesnt raise an eintr error .