diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-02-11 01:33:27 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-02-11 01:33:27 +0000 |
commit | 7e34c2e10baa325f2ca22a12e655b1729ae59785 (patch) | |
tree | 571734e2325704f6b9400cb603f75210d2109070 /numpy/core/src/arrayobject.c | |
parent | fc7ac38dec262117bbc30698e0696e9911369207 (diff) | |
download | numpy-7e34c2e10baa325f2ca22a12e655b1729ae59785.tar.gz |
Change PyArray_Put so that values0 is forcecast to the right type.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 76be69702..cfca0242e 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -5739,7 +5739,7 @@ PyArray_FromArray(PyArrayObject *arr, PyArray_Descr *newtype, int flags) /* Cast to the desired type if we can do it safely Also cast if source is a ndim-0 array to mimic behavior with Python scalars */ - if (flags & FORCECAST || PyArray_NDIM(arr)==0 || + if ((flags & FORCECAST) || PyArray_NDIM(arr)==0 || PyArray_CanCastTo(oldtype, newtype)) { if ((flags & UPDATEIFCOPY) && \ (!PyArray_ISWRITEABLE(arr))) { |