Skip to content

Commit 9ac67bd

Browse files
committed
fixup! Fix arguments for ArrayValue.__array__()
1 parent 7f810f8 commit 9ac67bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/JlWrap/array.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ function init_array()
365365
except ImportError:
366366
numpy = None
367367
if numpy is not None:
368+
# Numpy <2 does not support `copy=None` argument, so we have to check the version
369+
major_version = int(numpy.__version__.split(".")[0])
370+
if major_version < 2 and copy is None:
371+
copy = False
368372
return numpy.array(arr, dtype=dtype, copy=copy)
369373
return arr
370374
def to_numpy(self, dtype=None, copy=True, order="K"):

0 commit comments

Comments
 (0)