Skip to content

Commit 459a79f

Browse files
author
Christopher Doris
committed
fix bug in JlIO.fileno() from change of return type of fd()
1 parent 47dc548 commit 459a79f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/JlWrap/io.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pyjlio_closed(io::IO) = Py(!isopen(io))
1010
pyjl_handle_error_type(::typeof(pyjlio_closed), io, exc) =
1111
exc isa MethodError && exc.f === isopen ? pybuiltins.ValueError : PyNULL
1212

13-
pyjlio_fileno(io::IO) = Py(fd(io))
13+
pyjlio_fileno(io::IO) = Py(Base.cconvert(Cint, fd(io))::Cint)
1414
pyjl_handle_error_type(::typeof(pyjlio_fileno), io, exc) =
1515
exc isa MethodError && exc.f === fd ? pybuiltins.ValueError : PyNULL
1616

test/JlWrap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ end
718718
y = pytextio(x)
719719
z = y.fileno()
720720
@test pyisinstance(z, pybuiltins.int)
721-
@test pyeq(Bool, z, fd(x))
721+
@test z == Base.cconvert(Cint, fd(x))
722722
end
723723
end
724724
@testset "flush" begin

0 commit comments

Comments
 (0)