From 4b2a609396783db8cc85ebdc42b112d490bdca72 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 25 Apr 2018 18:12:45 +0700 Subject: [PATCH] Ignore Sys_error in Path.exists --- src/stdune/path.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stdune/path.ml b/src/stdune/path.ml index 4da893c1..2ee27dbe 100644 --- a/src/stdune/path.ml +++ b/src/stdune/path.ml @@ -426,7 +426,9 @@ let explode_exn t = Exn.code_error "Path.explode_exn" ["path", Sexp.atom_or_quoted_string t] -let exists t = Sys.file_exists (to_string t) +let exists t = + try Sys.file_exists (to_string t) + with Sys_error _ -> false let readdir t = Sys.readdir (to_string t) |> Array.to_list let is_directory t = try Sys.is_directory (to_string t)