code: def temp_fail_retry(error, fun, *args):
      
      while 1:
          try:
              return fun(*args)
          except error as e:
              eintr = errno.WSAEINTR if os.name == 'nt' else errno.EINTR
              if e.args[0] == eintr:
                  continue
              raise
docs: Retry to execute function, ignoring EINTR error (interruptions)