mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-14 17:43:53 +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:
|
||||
na = np.array([], dtype=np_array_dtype)
|
||||
bi = m.get_buffer_info(na)
|
||||
if fmt in ("i", "q"):
|
||||
assert bi.format in [fmt, "l"]
|
||||
elif fmt in ("I", "Q"):
|
||||
assert bi.format in [fmt, "L"]
|
||||
else:
|
||||
assert bi.format == fmt
|
||||
bif = bi.format
|
||||
if bif == "l":
|
||||
bif = "i" if bi.itemsize == 4 else "q"
|
||||
elif bif == "L":
|
||||
bif = "I" if bi.itemsize == 4 else "Q"
|
||||
assert bif == fmt
|
||||
|
||||
|
||||
def test_from_python():
|
||||
|
Loading…
Reference in New Issue
Block a user