Skip to content

Commit

Permalink
invokelatest nowadays supports kwargs (fixes #873)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored Dec 29, 2020
1 parent bbe4efc commit 34ff27d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/callback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ function _pyjlwrap_call(f, args_::PyPtr, kw_::PyPtr)
else
kw = PyDict{Symbol,PyObject}(pyincref(kw_))
kwargs = [ (k,julia_kwarg(f,k,v)) for (k,v) in kw ]

# 0.6 `invokelatest` doesn't support kwargs, instead
# use a closure over kwargs. see:
# https://github.com/JuliaLang/julia/pull/22646
f_kw_closure() = f(jlargs...; kwargs...)
ret = Core._apply_latest(f_kw_closure)
ret = Base.invokelatest(f, jlargs...; kwargs...)
end

return pyreturn(ret)
Expand Down

1 comment on commit 34ff27d

@simeonschaub
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevengj Mind tagging a new patch release?

Please sign in to comment.