From a0e37f250edf86b68ff0e26380883e9a3bf88434 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Sun, 26 Jun 2016 16:34:39 +0100 Subject: [PATCH] npy_format_descriptor::format() - fail if unbound --- include/pybind11/numpy.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index f9408526..73cdce0e 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -234,6 +234,8 @@ template struct npy_format_descriptor } static const char* format() { + if (!dtype_()) + pybind11_fail("NumPy: unsupported buffer format!"); return format_(); }