Skip to content

Commit

Permalink
fix: patch changed behavior of setproperty! for modules
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Jan 1, 2025
1 parent a61c022 commit ddf15ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/JlWrap/any.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ function pyjlany_setattr(self, k_::Py, v_::Py)
k = Symbol(pyjl_attr_py2jl(pyconvert(String, k_)))
pydel!(k_)
v = pyconvert(Any, v_)
if VERSION >= v"1.11.0-" && self isa Module && !isdefined(self, k)
# Fix for https://github.com/JuliaLang/julia/pull/54678
Base.Core.eval(self, Expr(:global, k))
end
setproperty!(self, k, v)
Py(nothing)
end
Expand Down

0 comments on commit ddf15ed

Please sign in to comment.