From b671e9ab93d8a21c31e17d572f55af2bcb528e76 Mon Sep 17 00:00:00 2001 From: "Jason McCampbell (Enthought, Inc)" Date: Wed, 2 Mar 2011 10:07:46 -0600 Subject: [PATCH] NpyArray.CheckFromAny wasn't converting arrays to native byte order. --- numpy/NumpyDotNet/NpyArray.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numpy/NumpyDotNet/NpyArray.cs b/numpy/NumpyDotNet/NpyArray.cs index fa00d2b46..47a709e04 100644 --- a/numpy/NumpyDotNet/NpyArray.cs +++ b/numpy/NumpyDotNet/NpyArray.cs @@ -115,8 +115,8 @@ public static ndarray CheckFromAny(Object src, dtype descr, int minDepth, int maxDepth, int requires, Object context) { if ((requires & NpyDefs.NPY_NOTSWAPPED) != 0) { - if (descr != null && src is ndarray && - ((ndarray)src).Dtype.IsNativeByteOrder) { + if (descr == null && src is ndarray && + !((ndarray)src).Dtype.IsNativeByteOrder) { descr = new dtype(((ndarray)src).Dtype); } else if (descr != null && !descr.IsNativeByteOrder) { // Descr replace