Skip to content

Commit b44f430

Browse files
committed
Fix 1.12 world-age issue
1 parent b5862d8 commit b44f430

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AbbreviatedStackTraces"
22
uuid = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
33
authors = ["Nicholas Bauer <nicholasbauer@outlook.com>"]
4-
version = "0.3.2"
4+
version = "0.3.3"
55

66
[weakdeps]
77
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"

ext/AbbrvStackTracesREPLExt.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if VERSION ≥ v"1.11"
1111
REPL.repl_display_error(errio::IO, @nospecialize errval) = repl_display_error_abbrv(errio, errval)
1212
end
1313

14+
15+
1416
if VERSION v"1.12-alpha"
1517
function REPL.print_response(errio::IO, response, backend::Union{REPL.REPLBackendRef,Nothing}, show_value::Bool, have_color::Bool, specialdisplay::Union{AbstractDisplay,Nothing}=nothing)
1618
Base.sigatomic_begin()
@@ -26,9 +28,7 @@ if VERSION ≥ v"1.12-alpha"
2628
if val !== nothing && show_value
2729
val2, iserr = if specialdisplay === nothing
2830
# display calls may require being run on the main thread
29-
REPL.call_on_backend(backend) do
30-
Base.invokelatest(display, val)
31-
end
31+
Base.invokelatest(display, val), false
3232
else
3333
REPL.call_on_backend(backend) do
3434
Base.invokelatest(display, specialdisplay, val)
@@ -65,6 +65,11 @@ if VERSION ≥ v"1.12-alpha"
6565
Base.sigatomic_end()
6666
nothing
6767
end
68+
function REPL.call_on_backend(f, backend::REPL.REPLBackendRef)
69+
applicable(f) || error("internal error: f is not callable")
70+
put!(backend.repl_channel, (f, 2)) # (f, show_value) 2 indicates function (rather than ast)
71+
return take!(backend.response_channel) # (val, iserr)
72+
end
6873
else
6974
function REPL.print_response(errio::IO, response, show_value::Bool, have_color::Bool, specialdisplay::Union{AbstractDisplay,Nothing}=nothing)
7075
Base.sigatomic_begin()

0 commit comments

Comments
 (0)