Skip to content

Commit 38527e1

Browse files
fix: make @ft macro hygienic
1 parent 90f4ea5 commit 38527e1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/C/extras.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ CTX.is_free_threaded` throughout the code.
4343
"""
4444
macro ft(ex)
4545
ex_ft = _ft_transform(ex)
46-
return :(if CTX.is_free_threaded
47-
$(esc(ex_ft))
46+
ctx = GlobalRef(@__MODULE__, :CTX)
47+
return esc(:(if $ctx.is_free_threaded
48+
$ex_ft
4849
else
49-
$(esc(ex))
50-
end)
50+
$ex
51+
end))
5152
end
5253

5354
Py_Type(x) = Base.GC.@preserve x @ft PyPtr(UnsafePtr{PyObject}(asptr(x)).type[!])

0 commit comments

Comments
 (0)