From 701f78b38606b0ccaced000ae5bb5b053c53a8d9 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Fri, 21 Feb 2025 11:01:29 +0100 Subject: [PATCH] Update otherlibs/stdune/src/fpath.ml Co-authored-by: Marek Kubica Signed-off-by: Jules Aguillon --- otherlibs/stdune/src/fpath.ml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/otherlibs/stdune/src/fpath.ml b/otherlibs/stdune/src/fpath.ml index 9a180fd7695..1d48f5342eb 100644 --- a/otherlibs/stdune/src/fpath.ml +++ b/otherlibs/stdune/src/fpath.ml @@ -219,9 +219,7 @@ let traverse_files ~dir ~init ~f = ;; let is_rw p = - try - Unix.access p Unix.[ R_OK; W_OK ]; - true - with - | Unix.Unix_error _ -> false + match Unix.access p Unix.[ R_OK; W_OK ] with + | () -> true + | exception Unix.Unix_error _ -> false ;;