From 6d950e9af15d52c47f8e31141b206808fd665b72 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Sat, 13 Jul 2024 11:55:29 -0700 Subject: [PATCH] BUG: fix f2py tests to work with v2 API This is a clear bug which CI unfortunately doesn't see because it just skips the f2py test if compilation fails (which it does here). The error is slightly more precise now, but not precise enough to avoid that issue. --- numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c | 2 +- numpy/f2py/tests/util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c index f3bffdc1c220..8c6ba1396924 100644 --- a/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c +++ b/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c @@ -115,7 +115,7 @@ static PyObject *f2py_rout_wrap_attrs(PyObject *capi_self, PyArray_DESCR(arr)->type, PyArray_TYPE(arr), PyArray_ITEMSIZE(arr), - PyArray_DESCR(arr)->alignment, + PyDataType_ALIGNMENT(arr), PyArray_FLAGS(arr), PyArray_ITEMSIZE(arr)); } diff --git a/numpy/f2py/tests/util.py b/numpy/f2py/tests/util.py index c2258791e6d9..eab827127e95 100644 --- a/numpy/f2py/tests/util.py +++ b/numpy/f2py/tests/util.py @@ -332,7 +332,7 @@ def build_meson(source_files, module_name=None, **kwargs): # compiler stack is on the CI try: backend.compile() - except: + except subprocess.CalledProcessError: pytest.skip("Failed to compile module") # Import the compiled module