Skip to content

Commit

Permalink
REV: Revert pull request numpy#20466 from charris/backport-20365
Browse files Browse the repository at this point in the history
This reverts commit 157ee4f, reversing
changes made to 87d6f96.

The reverted PR was a mistaken backport that introduced C++ into the
1.21.5 release, causing problems for some projects.

Closes numpy#20765.
  • Loading branch information
charris committed Jan 10, 2022
1 parent 7cfef93 commit ae0bf30
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/descriptor.c
Expand Up @@ -1325,7 +1325,7 @@ _convert_from_dict(PyObject *obj, int align)
goto fail;
}
/* If align is set, make sure the alignment divides into the size */
if (align && new->alignment > 0 && itemsize % new->alignment != 0) {
if (align && itemsize % new->alignment != 0) {
PyErr_Format(PyExc_ValueError,
"NumPy dtype descriptor requires alignment of %d bytes, "
"which is not divisible into the specified itemsize %d",
Expand Down
6 changes: 0 additions & 6 deletions numpy/core/tests/test_dtype.py
Expand Up @@ -621,12 +621,6 @@ def test_alignment(self):
t2 = np.dtype('2i4', align=True)
assert_equal(t1.alignment, t2.alignment)

def test_aligned_empty(self):
# Mainly regression test for gh-19696: construction failed completely
dt = np.dtype([], align=True)
assert dt == np.dtype([])
dt = np.dtype({"names": [], "formats": [], "itemsize": 0}, align=True)
assert dt == np.dtype([])

def iter_struct_object_dtypes():
"""
Expand Down

0 comments on commit ae0bf30

Please sign in to comment.