Skip to content

Commit e00da91

Browse files
author
Christopher Doris
committed
remove try/catch which always throws
1 parent a6ec34a commit e00da91

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/pywrap/PyArray.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,10 @@ end
7676
abstract type PyArraySource end
7777

7878
function pyarray_make(::Type{A}, x::Py; array::Bool=true, buffer::Bool=true, copy::Bool=true) where {A<:PyArray}
79+
# TODO: try/catch is SLOW if an error is thrown, think about sending errors via return values instead
7980
A == Union{} && return pyconvert_unconverted()
8081
if array && pyhasattr(x, "__array_struct__")
81-
try
82-
return pyarray_make(A, x, PyArraySource_ArrayStruct(x))
83-
catch exc
84-
@debug "failed to make PyArray from __array_struct__" exc=exc
85-
end
82+
@debug "not implemented: creating PyArray from __array_struct__"
8683
end
8784
if array && pyhasattr(x, "__array_interface__")
8885
try
@@ -101,11 +98,7 @@ function pyarray_make(::Type{A}, x::Py; array::Bool=true, buffer::Bool=true, cop
10198
if copy && array && pyhasattr(x, "__array__")
10299
y = x.__array__()
103100
if pyhasattr(y, "__array_struct__")
104-
try
105-
return pyarray_make(A, y, PyArraySource_ArrayStruct(y))
106-
catch exc
107-
@debug "failed to make PyArray from __array__().__array_struct__" exc=exc
108-
end
101+
@debug "not implemented: creating PyArray from __array__().__array_struct__"
109102
end
110103
if pyhasattr(y, "__array_interface__")
111104
try

0 commit comments

Comments
 (0)