diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index dfbdc498..d3d8e103 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -96,7 +96,7 @@ public: array(const buffer_info &info) { API& api = lookup_api(); - if (info.format.size() != 1) + if ((info.format.size() < 1) || (info.format.size() > 2)) throw std::runtime_error("Unsupported buffer format!"); int fmt = (int) info.format[0]; if (info.format == "Zd")