Skip to content

Commit 53d870d

Browse files
authored
bugfix in numpy scalars (#481) (#499)
1 parent d2084b3 commit 53d870d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ os:
55
julia:
66
- 0.6
77
- nightly
8+
addons:
9+
apt:
10+
packages:
11+
- python-numpy
12+
- python3-numpy
813
env:
914
global:
1015
- PYCALL_DEBUG_BUILD="yes"

src/conversions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PyObject(n::Nothing) = pyerr_check("PyObject(nothing)", pyincref(pynothing[]))
2525
# conversions to Julia types from PyObject
2626

2727
# numpy scalars need o.item() conversion in Python 3
28-
unsafe_asscalar(o) = PyObject(ccall((@pysym :PyObject_GetAttrString), PyPtr, (PyPtr, Cstring), o, "item"))
28+
unsafe_asscalar(o) = pycall(PyObject(ccall((@pysym :PyObject_GetAttrString), PyPtr, (PyPtr, Cstring), o, "item")), PyObject)
2929

3030
function convert(::Type{T}, po::PyObject) where {T<:Integer}
3131
i = ccall(@pysym(PyInt_AsSsize_t), Int, (PyPtr,), po)

0 commit comments

Comments
 (0)