diff --git a/src/core/mkshims.ml b/src/core/mkshims.ml index 811f2fe4..447ae058 100644 --- a/src/core/mkshims.ml +++ b/src/core/mkshims.ml @@ -58,8 +58,8 @@ let shims_fun_mli_pre_408 = (** This is the [Fun] module distributed with the OCaml Core system. It is linked with containers in case the installed OCaml system does not provide a compatible [Fun] module. - It is the an unmodified version of [Fun] as shipped with the OCaml core - system. + It is the a slightly modified version of [Fun] as shipped with the OCaml + core system. *) " ^ read_file "stdlib/fun.mli" diff --git a/src/core/stdlib/fun.ml b/src/core/stdlib/fun.ml index 247f107e..db48d060 100644 --- a/src/core/stdlib/fun.ml +++ b/src/core/stdlib/fun.ml @@ -23,12 +23,10 @@ exception Finally_raised of exn let protect ~(finally : unit -> unit) work = let finally_no_exn () = try finally () with e -> - let bt = Printexc.get_raw_backtrace () in - Printexc.raise_with_backtrace (Finally_raised e) bt + raise (Finally_raised e) in match work () with | result -> finally_no_exn () ; result | exception work_exn -> - let work_bt = Printexc.get_raw_backtrace () in finally_no_exn () ; - Printexc.raise_with_backtrace work_exn work_bt + raise work_exn