Skip to content

Commit 8b93e08

Browse files
committed
Nothing can not be printed ...
1 parent 5b428ee commit 8b93e08

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/base.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ function show(io::IO, ev::AbstractEvent)
2727
end
2828

2929
function show(io::IO, env::Environment)
30-
active_proc = try get(sim.active_proc) catch; nothing end
31-
print(io, "$(typeof(env)) time: $(now(env)) active_process: $(active_proc)")
30+
if env.active_proc == nothing
31+
print(io, "$(typeof(env)) time: $(now(env)) active_process: nothing")
32+
else
33+
print(io, "$(typeof(env)) time: $(now(env)) active_process: $(active_proc)")
34+
end
3235
end
3336

3437
function environment(ev::AbstractEvent) :: Environment

test/base.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ println(typeof(ev))
1010
cb = @callback test_callback(ev)
1111
remove_callback(cb, ev)
1212
println(state(ev))
13-
println(value(ev))
13+
show(value(ev))
14+
println()
1415
succeed(ev, value="Hi")
1516
@callback test_callback(ev)
1617
println(state(ev))

0 commit comments

Comments
 (0)