Skip to content

Commit ead312f

Browse files
authored
Fix tests, Core.TypeofVararg for Julia 1.7 and AOT (#877)
* Fix tests, Core.TypeofVararg for Julia 1.7 and AOT * Replace Core.TypeofVararg with typeof(Vararg)
1 parent 318c23f commit ead312f

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.github/workflows/aot.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ jobs:
4141
arch: ${{ matrix.architecture }}
4242
show-versioninfo: true
4343

44-
# Revert to `@v1` after this PR is merged:
45-
# https://github.com/JuliaLang/PackageCompiler.jl/pull/443
46-
- run: julia -e 'using Pkg; pkg"add PackageCompiler#cb994c72e2087c57ffa4727ef93589e1b98d8a32"'
47-
48-
# Workaround https://github.com/JuliaLang/julia/issues/37441.
49-
# Once it's solved, we can remove the following line:
50-
- run: julia -e 'using Pkg; pkg"dev PyCall"'
44+
- run: julia -e 'using Pkg; pkg"add PackageCompiler@v1"'
5145

5246
- run: aot/compile.jl
5347
- run: aot/assert_has_pycall.jl

aot/runtests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
thisdir="$(dirname "${BASH_SOURCE[0]}")"
3-
exec "$thisdir/julia.sh" --startup-file=no --color=yes -e '
3+
exec "$thisdir/julia.sh" --startup-file=no --color=yes --project=$thisdir -e '
44
using Pkg
55
Pkg.test("PyCall")
66
'

src/conversions.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ function pyany_toany(T::Type)
170170
end
171171
pyany_toany(::Type{PyAny}) = Any
172172
pyany_toany(t::Type{T}) where {T<:Tuple} = Tuple{map(pyany_toany, t.types)...}
173-
173+
@static if isdefined(Core, :TypeofVararg) # VERSION >= v"1.7.0-DEV.77"
174+
# Core.TypeofVararg introduced in https://github.com/JuliaLang/julia/pull/38136
175+
pyany_toany(T::typeof(Vararg)) = T === Vararg{PyAny} ? Vararg{Any} : T
176+
end
174177
# PyAny acts like Any for conversions, except for converting PyObject (below)
175178
convert(::Type{PyAny}, x) = x
176179

0 commit comments

Comments
 (0)