diff options
author | Sam James <sam@gentoo.org> | 2023-07-23 22:43:10 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-07-23 22:43:14 +0100 |
commit | bda70e66142a13cf3d2a41c80354a10c6b623dee (patch) | |
tree | 308e6cafd84e6bbc86d968cf1df6ec325cb15c52 /dev-python/numpy/files | |
parent | app-text/zathura-pdf-poppler: Stabilize 0.3.1-r1 x86, #909791 (diff) | |
download | gentoo-bda70e66142a13cf3d2a41c80354a10c6b623dee.tar.gz gentoo-bda70e66142a13cf3d2a41c80354a10c6b623dee.tar.bz2 gentoo-bda70e66142a13cf3d2a41c80354a10c6b623dee.zip |
dev-python/numpy: fix type confusion in scalartypes
And skip another f2py test as well for big endian.
Closes: https://bugs.gentoo.org/910739
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/numpy/files')
-rw-r--r-- | dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch b/dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch new file mode 100644 index 000000000000..845b41fef23a --- /dev/null +++ b/dev-python/numpy/files/numpy-1.25.1-fix-scalartypes.patch @@ -0,0 +1,36 @@ +https://bugs.gentoo.org/910739 +https://github.com/numpy/numpy/issues/24239 +https://github.com/numpy/numpy/pull/24240 + +From f5eb12cafc99bb33dad6535dacab2f592aafb2b0 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Sun, 23 Jul 2023 21:31:08 +0100 +Subject: [PATCH] BUG: Fix C types in scalartypes + +https://github.com/numpy/numpy/pull/23746 introduced a fast path for scalar +int conversions, but the map between Python types and C types was subtly +wrong. + +This fixes tests on at least ppc32 (big-endian). + +Many thanks to Sebastian Berg for debugging this with me and pointing out +what needed to be fixed. + +Closes #24239. + +Fixes: 81caed6e3c34c4bf4b22b4f6167e816ba2a3f73c +--- a/numpy/core/src/multiarray/scalartypes.c.src ++++ b/numpy/core/src/multiarray/scalartypes.c.src +@@ -301,10 +301,10 @@ genint_type_str(PyObject *self) + item = PyLong_FromUnsignedLong(*(uint32_t *)val); + break; + case NPY_LONG: +- item = PyLong_FromLong(*(int64_t *)val); ++ item = PyLong_FromLong(*(long *)val); + break; + case NPY_ULONG: +- item = PyLong_FromUnsignedLong(*(uint64_t *)val); ++ item = PyLong_FromUnsignedLong(*(unsigned long *)val); + break; + case NPY_LONGLONG: + item = PyLong_FromLongLong(*(long long *)val); |