From 9608504b579e6a594a1b59abd6b8904c430ec232 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 6 Jul 2016 14:22:34 -0700 Subject: [PATCH] Ignore non-existent dirs when looking for specs Summary: In InferPrint, ignore non-existent dirs when looking for specs. This allows InferPrint to work when the results dir does not exist. Reviewed By: sblackshear Differential Revision: D3522757 fbshipit-source-id: 5ef905d --- infer/src/backend/inferprint.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/backend/inferprint.ml b/infer/src/backend/inferprint.ml index 608c67a2f..a9fc5c731 100644 --- a/infer/src/backend/inferprint.ml +++ b/infer/src/backend/inferprint.ml @@ -32,7 +32,7 @@ let load_specfiles () = let specs_files_in_dir dir = let is_specs_file fname = not (Sys.is_directory fname) && Filename.check_suffix fname Config.specs_files_suffix in - let all_filenames = Array.to_list (Sys.readdir dir) in + let all_filenames = try Array.to_list (Sys.readdir dir) with Sys_error _ -> [] in let all_filepaths = IList.map (fun fname -> Filename.concat dir fname) all_filenames in IList.filter is_specs_file all_filepaths in let specs_dirs =