Skip to content

Commit fa2284e

Browse files
committed
dtype_from_numpy: "l"/"L"
Fix: `TypeError: data type 'ulong' not understood` on GCC 9 w/ Python 3.10 on Linux.
1 parent 085ef1c commit fa2284e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

include/openPMD/binding/python/Numpy.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ inline Datatype dtype_from_numpy(pybind11::dtype const dt)
5858
return Datatype::INT;
5959
else if (dt.char_() == pybind11::dtype("int_").char_())
6060
return Datatype::LONG;
61-
else if (dt.char_() == pybind11::dtype("long").char_()) // alias used on
62-
// Win64
61+
else if (dt.char_() == pybind11::dtype("l").char_()) // alias used on Win64
6362
return Datatype::LONG;
6463
else if (dt.char_() == pybind11::dtype("longlong").char_())
6564
return Datatype::LONGLONG;
@@ -69,8 +68,7 @@ inline Datatype dtype_from_numpy(pybind11::dtype const dt)
6968
return Datatype::UINT;
7069
else if (dt.char_() == pybind11::dtype("uint").char_())
7170
return Datatype::ULONG;
72-
else if (dt.char_() == pybind11::dtype("ulong").char_()) // alias used on
73-
// Win64
71+
else if (dt.char_() == pybind11::dtype("L").char_()) // alias used on Win64
7472
return Datatype::ULONG;
7573
else if (dt.char_() == pybind11::dtype("ulonglong").char_())
7674
return Datatype::ULONGLONG;

0 commit comments

Comments
 (0)