From 30eb06874bf532c8a8d3f618394a4fb6df7c500d Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 22 Jun 2018 11:18:32 -0400 Subject: [PATCH] Retry fetching from unicode.org when it fails. --- pkgs/racket-test-core/tests/racket/uni-norm.rktl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/racket-test-core/tests/racket/uni-norm.rktl b/pkgs/racket-test-core/tests/racket/uni-norm.rktl index f7420968cf..7df7d450d8 100644 --- a/pkgs/racket-test-core/tests/racket/uni-norm.rktl +++ b/pkgs/racket-test-core/tests/racket/uni-norm.rktl @@ -22,11 +22,13 @@ (define path (build-path dir name)) (and (file-exists? path) path)) (let ([path (build-path here name)]) - (with-output-to-file path - (lambda () - (copy-port (get-pure-port (string->url (string-append base name))) - (current-output-port)))) - path))) + (define (try) + (with-handlers ([exn:fail? (lambda (x) #f)]) + (with-output-to-file path + (lambda () + (copy-port (get-pure-port (string->url (string-append base name))) + (current-output-port)))))) + (and (for/or ([_ 5]) (try)) path)))) (printf "Reading tests...\n") (define test-strings