Skip to content

Commit

Permalink
fix #21233, start REPL when script run with -i throws an error
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Nov 29, 2018
1 parent 3f8c311 commit ad07f8b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ Language changes
the macro (`@int128_str`, `@uint128_str`, `@big_str`, `@cmd`) qualified to refer
to the `Core` module ([#29968]).

Command-line option changes
---------------------------

* When a script run in interactive mode (`-i`) throws an error, the REPL now starts after
the error is displayed. Previously the REPL only started if the script completed without
error ([#21233]).

New library functions
---------------------

Expand Down
9 changes: 8 additions & 1 deletion base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ function exec_options(opts)
if !is_interactive
ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 1)
end
include(Main, PROGRAM_FILE)
try
include(Main, PROGRAM_FILE)
catch err
invokelatest(display_error, err, catch_backtrace())
if !is_interactive
exit(1)
end
end
end
repl |= is_interactive
if repl
Expand Down

0 comments on commit ad07f8b

Please sign in to comment.