From d200baacb3101ea95ccd4c2cb7eb02446f6c29bc Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Thu, 1 Aug 2013 19:31:18 -0400 Subject: [PATCH] Fix #33 --- src/io.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/io.jl b/src/io.jl index 77730a72..381fdd9d 100644 --- a/src/io.jl +++ b/src/io.jl @@ -214,7 +214,7 @@ end function jl_IO_writelines(self_::PyPtr, arg_::PyPtr) try io = unsafe_pyjlwrap_to_objref(self_)::IO - for s in PyVector{String}(PyObject(arg_)) + for s in PyVector{String}(pyincref(PyObject(arg_))) write(io, s) end ccall((@pysym :Py_IncRef), Void, (PyPtr,), pynothing::PyPtr) @@ -263,7 +263,7 @@ end function jl_IO_readinto(self_::PyPtr, arg_::PyPtr) try io = unsafe_pyjlwrap_to_objref(self_)::IO - b = convert(Vector{Uint8}, PyObject(arg_)) + b = convert(Vector{Uint8}, pyincref(PyObject(arg_))) return pyincref(PyObject(readbytes!(io, b))).o catch e ioraise(e) @@ -274,7 +274,7 @@ end function jl_IO_write(self_::PyPtr, arg_::PyPtr) try io = unsafe_pyjlwrap_to_objref(self_)::IO - b = convert(Vector{Uint8}, PyObject(arg_)) + b = convert(Vector{Uint8}, pyincref(PyObject(arg_))) return pyincref(PyObject(write(io, b))).o catch e ioraise(e)