Skip to content

Commit 3bc3d3a

Browse files
author
Christopher Doris
committed
fix some NULLs that should be -1
1 parent de73685 commit 3bc3d3a

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/cpython/juliaany.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pyjlany_setattro(xo::PyPtr, ko::PyPtr, vo::PyPtr) = begin
6161
# If has double leading and trailing underscore, do not allow
6262
if length(k) > 4 && startswith(k, "__") && endswith(k, "__")
6363
PyErr_SetString(PyExc_AttributeError(), "'$(PyType_Name(Py_Type(xo)))' object has no attribute '$k'")
64-
return PyNULL
64+
return Cint(-1)
6565
end
6666
# Look up a property on the Julia object
6767
k = pyjl_attr_py2jl(k)

src/cpython/juliaraw.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pyjlraw_setattro(xo::PyPtr, ko::PyPtr, vo::PyPtr) = begin
5252
# If has double leading and trailing underscore, do not allow
5353
if length(k) > 4 && startswith(k, "__") && endswith(k, "__")
5454
PyErr_SetString(PyExc_AttributeError(), "'$(PyType_Name(Py_Type(xo)))' object has no attribute '$k'")
55-
return PyNULL
55+
return Cint(-1)
5656
end
5757
# Look up a property on the Julia object
5858
k = pyjl_attr_py2jl(k)
@@ -116,14 +116,14 @@ end
116116

117117
pyjlraw_setitem(xo::PyPtr, ko::PyPtr, vo::PyPtr) = begin
118118
x = PyJuliaValue_GetValue(xo)
119-
ism1(PyObject_Convert(vo, Any)) && return PyNULL
119+
ism1(PyObject_Convert(vo, Any)) && return Cint(-1)
120120
v = takeresult(Any)
121121
if PyTuple_Check(ko)
122-
ism1(PyObject_Convert(ko, Tuple)) && return PyNULL
122+
ism1(PyObject_Convert(ko, Tuple)) && return Cint(-1)
123123
k = takeresult(Tuple)
124124
@pyjltry (x[k...] = v; Cint(0)) Cint(-1)
125125
else
126-
ism1(PyObject_Convert(ko, Any)) && return PyNULL
126+
ism1(PyObject_Convert(ko, Any)) && return Cint(-1)
127127
k = takeresult(Any)
128128
@pyjltry (x[k] = v; Cint(0)) Cint(-1)
129129
end

src/julia.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
pyjlbasetype(::Type{T}) where {T} = checknullconvert(T, C.PyJuliaBaseValue_Type())
2-
pyjlbasetype() = pyjlbasetype(PyObject)
3-
4-
pyjlrawtype(::Type{T}) where {T} = checknullconvert(T, C.PyJuliaRawValue_Type())
5-
pyjlrawtype() = pyjlrawtype(PyObject)
6-
71
"""
82
pyjlraw([T=PyObject,] x)
93

0 commit comments

Comments
 (0)