Skip to content

Commit d96d28e

Browse files
timholyjrevels
authored andcommitted
Fix current_module deprecation on 0.7 (#61)
1 parent d70f0dd commit d96d28e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
julia 0.4
2-
Compat 0.9.0
2+
Compat 0.26
33
JLD 0.6.6

src/execution.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ end
2929
# execution #
3030
#############
3131
# Note that trials executed via `run` and `lineartrial` are always executed at the top-level
32-
# scope of the module returned by `current_module()`. This is to avoid any weird quirks
32+
# scope of the module returned by `@__MODULE__`. This is to avoid any weird quirks
3333
# when calling the experiment from within other contexts.
3434

3535
sample(b::Benchmark, args...) = error("no execution method defined on type $(typeof(b))")
3636
_run(b::Benchmark, args...; kwargs...) = error("no execution method defined on type $(typeof(b))")
3737

3838
# return (Trial, result) tuple, where result is the result of the benchmarked expression
3939
function run_result(b::Benchmark, p::Parameters = b.params; kwargs...)
40-
return eval(current_module(), :(BenchmarkTools._run($(b), $(p); $(kwargs...))))
40+
return eval(@__MODULE__, :(BenchmarkTools._run($(b), $(p); $(kwargs...))))
4141
end
4242

4343
Base.run(b::Benchmark, p::Parameters = b.params; kwargs...) =
@@ -72,7 +72,7 @@ function _lineartrial(b::Benchmark, p::Parameters = b.params; maxevals = RESOLUT
7272
end
7373

7474
function lineartrial(b::Benchmark, p::Parameters = b.params; kwargs...)
75-
return eval(current_module(), :(BenchmarkTools._lineartrial($(b), $(p); $(kwargs...))))
75+
return eval(@__MODULE__, :(BenchmarkTools._lineartrial($(b), $(p); $(kwargs...))))
7676
end
7777

7878
warmup(item; verbose::Bool = true) = run(item; verbose = verbose, samples = 1, evals = 1,
@@ -250,7 +250,7 @@ macro benchmarkable(args...)
250250

251251
# generate the benchmark definition
252252
return esc(quote
253-
BenchmarkTools.generate_benchmark_definition(current_module(),
253+
BenchmarkTools.generate_benchmark_definition(@__MODULE__,
254254
$(Expr(:quote, out_vars)),
255255
$(Expr(:quote, setup_vars)),
256256
$(Expr(:quote, core)),

0 commit comments

Comments
 (0)