Skip to content

Commit ddf15ed

Browse files
committed
fix: patch changed behavior of setproperty! for modules
1 parent a61c022 commit ddf15ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/JlWrap/any.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ function pyjlany_setattr(self, k_::Py, v_::Py)
2626
k = Symbol(pyjl_attr_py2jl(pyconvert(String, k_)))
2727
pydel!(k_)
2828
v = pyconvert(Any, v_)
29+
if VERSION >= v"1.11.0-" && self isa Module && !isdefined(self, k)
30+
# Fix for https://github.com/JuliaLang/julia/pull/54678
31+
Base.Core.eval(self, Expr(:global, k))
32+
end
2933
setproperty!(self, k, v)
3034
Py(nothing)
3135
end

0 commit comments

Comments
 (0)