code: def retry_on_signal(function):
      
      while True:
          try:
              return function()
          except EnvironmentError, e:
              if e.errno != errno.EINTR:
                  raise
docs: Retries function until it doesn't raise an EINTR error