mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-15 01:44:44 +00:00
Use bi.itemsize to disambiguate "l" or "L"
This commit is contained in:
parent
7f124bb568
commit
d432ce75b3
@ -47,12 +47,12 @@ def test_format_descriptor_format(cpp_name, expected_fmts, np_array_dtype):
|
|||||||
if np_array_dtype is not None:
|
if np_array_dtype is not None:
|
||||||
na = np.array([], dtype=np_array_dtype)
|
na = np.array([], dtype=np_array_dtype)
|
||||||
bi = m.get_buffer_info(na)
|
bi = m.get_buffer_info(na)
|
||||||
if fmt in ("i", "q"):
|
bif = bi.format
|
||||||
assert bi.format in [fmt, "l"]
|
if bif == "l":
|
||||||
elif fmt in ("I", "Q"):
|
bif = "i" if bi.itemsize == 4 else "q"
|
||||||
assert bi.format in [fmt, "L"]
|
elif bif == "L":
|
||||||
else:
|
bif = "I" if bi.itemsize == 4 else "Q"
|
||||||
assert bi.format == fmt
|
assert bif == fmt
|
||||||
|
|
||||||
|
|
||||||
def test_from_python():
|
def test_from_python():
|
||||||
|
Loading…
Reference in New Issue
Block a user