Skip to content

Commit 1e85ebb

Browse files
author
Christopher Doris
committed
bugfix
1 parent 5ea63f1 commit 1e85ebb

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module Utils
9090
mimes = copy(ALL_MIMES)
9191
# look for mimes on show methods for this type
9292
for meth in methods(show, Tuple{IO, MIME, typeof(x)}).ms
93-
mimetype = meth.sig.parameters[3]
93+
mimetype = _type_ub(meth.sig).parameters[3]
9494
mimetype isa DataType || continue
9595
mime = string(mimetype.parameters[1])
9696
push!(mimes, mime)

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ using PythonCall, Test, Dates, Aqua
55
Aqua.test_all(PythonCall, unbound_args=false)
66

77
@testset "PythonCall.jl" begin
8+
@testset "utils" begin
9+
include("utils.jl")
10+
end
811
@testset "abstract" begin
912
include("abstract.jl")
1013
end

test/utils.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@testset "mimes_for" begin
2+
for x in Any[1, "foo", [], 'z']
3+
@test PythonCall.Utils.mimes_for(x) isa Vector{String}
4+
end
5+
end

0 commit comments

Comments
 (0)