You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
InterruptException can be caught in "simple" script (like sleep.jl below) provided that it's started using include (julia sleep.jl does not work: #25308). However, including @async in the script makes it impossible to catch InterruptException:
$ cat sleep.jltry println("sleeping") sleep(10)catch err @show errfinally println("done")end
$ julia --startup-file=no -e 'include("sleep.jl")'sleeping^Cerr = InterruptException()donejulia --startup-file=no -e 'include("sleep.jl")' 0.61s user 0.66s system 67% cpu 1.877 total
$ cat async.jl@async println("Hello!")try println("Hit ctrl-c!") sleep(10)catch err @show errfinally println("done")end
$ julia --startup-file=no -e 'include("async.jl")'Hit ctrl-c!Hello!^Cfatal: error thrown and no exception handler available.InterruptException()jl_run_once at /buildworker/worker/package_linux64/build/src/jl_uv.c:185process_events at ./libuv.jl:98 [inlined]wait at ./event.jl:246task_done_hook at ./task.jl:309jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1536 [inlined]finish_task at /buildworker/worker/package_linux64/build/src/task.c:233start_task at /buildworker/worker/package_linux64/build/src/task.c:276unknown function (ip: 0xffffffffffffffff)julia --startup-file=no -e 'include("async.jl")' 0.55s user 0.66s system 64% cpu 1.867 total
$ julia --versionjulia version 1.0.0
The text was updated successfully, but these errors were encountered:
InterruptException
can be caught in "simple" script (likesleep.jl
below) provided that it's started usinginclude
(julia sleep.jl
does not work: #25308). However, including@async
in the script makes it impossible to catchInterruptException
:The text was updated successfully, but these errors were encountered: