Skip to content

Commit 834ddb8

Browse files
IanButterworthKristofferC
authored andcommitted
Remove try-finally scope from @time_imports @trace_compile @trace_dispatch (#58011)
Matches `@time` `@profile` etc. (cherry picked from commit 1117df6)
1 parent ed902cf commit 834ddb8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

base/timing.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,12 @@ end
511511
# here so it's possible to time/trace all imports, including InteractiveUtils and its deps
512512
macro time_imports(ex)
513513
quote
514-
try
515-
Base.Threads.atomic_add!(Base.TIMING_IMPORTS, 1)
516-
$(esc(ex))
517-
finally
514+
Base.Threads.atomic_add!(Base.TIMING_IMPORTS, 1)
515+
@__tryfinally(
516+
# try
517+
$(esc(ex)),
518+
# finally
518519
Base.Threads.atomic_sub!(Base.TIMING_IMPORTS, 1)
519-
end
520+
)
520521
end
521522
end

0 commit comments

Comments
 (0)