aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/envars.ml18
-rw-r--r--lib/store.ml2
2 files changed, 9 insertions, 11 deletions
diff --git a/lib/envars.ml b/lib/envars.ml
index 47ecdb4005..84a41f8e44 100644
--- a/lib/envars.ml
+++ b/lib/envars.ml
@@ -154,7 +154,7 @@ let guess_camlbin () = which (user_path ()) (exe "ocamlc")
let camlbin () =
if !Flags.camlbin_spec then !Flags.camlbin else
if !Flags.boot then Coq_config.camlbin else
- try guess_camlbin () with _ -> Coq_config.camlbin
+ try guess_camlbin () with Not_found -> Coq_config.camlbin
let ocamlc () = camlbin () / Coq_config.ocamlc
@@ -175,15 +175,13 @@ let guess_camlp4bin () = which (user_path ()) (exe Coq_config.camlp4)
let camlp4bin () =
if !Flags.camlp4bin_spec then !Flags.camlp4bin else
if !Flags.boot then Coq_config.camlp4bin else
- try
- guess_camlp4bin ()
- with _ ->
- if Sys.file_exists (camlbin () / exe Coq_config.camlp4) then
- camlbin ()
- else
- Coq_config.camlp4bin
-
-let camlp4 () = camlp4bin () / Coq_config.camlp4
+ try guess_camlp4bin ()
+ with Not_found ->
+ let cb = camlbin () in
+ if Sys.file_exists (cb / exe Coq_config.camlp4) then cb
+ else Coq_config.camlp4bin
+
+let camlp4 () = camlp4bin () / exe Coq_config.camlp4
let camlp4lib () =
if !Flags.boot then
diff --git a/lib/store.ml b/lib/store.ml
index 4d6a74ec12..1cfea2525a 100644
--- a/lib/store.ml
+++ b/lib/store.ml
@@ -50,7 +50,7 @@ let set s (id : 'a field) (x : 'a) = Int.Map.add id (Obj.repr x) s
let get s (id : 'a field) : 'a option =
try Some (Obj.obj (Int.Map.find id s))
- with _ -> None
+ with Not_found -> None
let remove s (id : 'a field) =
Int.Map.remove id s