Skip to content

Commit 7622b67

Browse files
paddyroddyseberg
authored andcommitted
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.
1 parent c1d1ff4 commit 7622b67

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static PyObject *f2py_rout_wrap_attrs(PyObject *capi_self,
115115
PyArray_DESCR(arr)->type,
116116
PyArray_TYPE(arr),
117117
PyArray_ITEMSIZE(arr),
118-
PyArray_DESCR(arr)->alignment,
118+
PyDataType_ALIGNMENT(arr),
119119
PyArray_FLAGS(arr),
120120
PyArray_ITEMSIZE(arr));
121121
}

numpy/f2py/tests/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def build_meson(source_files, module_name=None, **kwargs):
328328
# compiler stack is on the CI
329329
try:
330330
backend.compile()
331-
except:
331+
except subprocess.CalledProcessError:
332332
pytest.skip("Failed to compile module")
333333

334334
# Import the compiled module

0 commit comments

Comments
 (0)