11const pyjlbasetype = pynew ()
22
3- _pyjl_getvalue (x) = @autopy x Cjl. PyJuliaValue_GetValue (x_ )
3+ _pyjl_getvalue (x) = @autopy x Cjl. PyJuliaValue_GetValue (getptr (x_) )
44
5- _pyjl_setvalue! (x, v) = @autopy x Cjl. PyJuliaValue_SetValue (x_ , v)
5+ _pyjl_setvalue! (x, v) = @autopy x Cjl. PyJuliaValue_SetValue (getptr (x_) , v)
66
7- pyjl (t, v) = pynew (errcheck (@autopy t Cjl. PyJuliaValue_New (t_ , v)))
7+ pyjl (t, v) = pynew (errcheck (@autopy t Cjl. PyJuliaValue_New (getptr (t_) , v)))
88
99"""
1010 pyisjl(x)
@@ -16,7 +16,7 @@ export pyisjl
1616
1717pyjlisnull (x) = @autopy x begin
1818 if pyisjl (x_)
19- Cjl. PyJuliaValue_IsNull (x_ )
19+ Cjl. PyJuliaValue_IsNull (getptr (x_) )
2020 else
2121 error (" Expecting a 'juliacall.ValueBase', got a '$(pytype (x_). __name__) '" )
2222 end
@@ -85,13 +85,13 @@ function Cjl._pyjl_callmethod(f, self_::C.PyPtr, args_::C.PyPtr, nargs::C.Py_ssi
8585 " __jl_callmethod not implemented for this many arguments" ,
8686 )
8787 end
88- return getptr ( incref (ans))
88+ return incref ( getptr (ans))
8989 catch exc
9090 if exc isa PyException
9191 Base. GC. @preserve exc C. PyErr_Restore (
92- incref (exc. _t),
93- incref (exc. _v),
94- incref (exc. _b),
92+ incref (getptr ( exc. _t) ),
93+ incref (getptr ( exc. _v) ),
94+ incref (getptr ( exc. _b) ),
9595 )
9696 return C. PyNULL
9797 else
@@ -126,7 +126,7 @@ function pyjl_handle_error(f, self, exc)
126126 return C. PyNULL
127127 else
128128 # Otherwise, return the given object (e.g. NotImplemented)
129- return getptr ( incref (t))
129+ return Base . GC . @preserve t incref ( getptr (t))
130130 end
131131end
132132
0 commit comments