aboutsummaryrefslogtreecommitdiff
path: root/toplevel/coqloop.ml
diff options
context:
space:
mode:
authorGaëtan Gilbert2020-01-08 17:03:17 +0100
committerGaëtan Gilbert2020-01-30 16:28:34 +0100
commit730298d07f95e024156726c86bb7aef9bb8bb544 (patch)
treef8e495bc44defba3b24e9e44db1ac260ad1cdea6 /toplevel/coqloop.ml
parent92a294ca53752b61b0270a719826ffc759a25e8d (diff)
coqtop: stop on Sys_blocked_io
Close #10918
Diffstat (limited to 'toplevel/coqloop.ml')
-rw-r--r--toplevel/coqloop.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/toplevel/coqloop.ml b/toplevel/coqloop.ml
index e1748d5c1c..977cae6254 100644
--- a/toplevel/coqloop.ml
+++ b/toplevel/coqloop.ml
@@ -469,6 +469,16 @@ let rec vernac_loop ~state =
(* Exception printing should be done by the feedback listener,
however this is not yet ready so we rely on the exception for
now. *)
+ | Sys_blocked_io ->
+ (* the parser doesn't like nonblocking mode, cf #10918 *)
+ let msg =
+ Pp.(strbrk "Coqtop needs the standard input to be in blocking mode." ++ spc()
+ ++ str "One way of clearing the non-blocking flag is through python:" ++ fnl()
+ ++ str " import os" ++ fnl()
+ ++ str " os.set_blocking(0, True)")
+ in
+ TopErr.print_error_for_buffer Feedback.Error msg top_buffer;
+ exit 1
| any ->
let (e, info) = CErrors.push any in
let loc = Loc.get_loc info in