From b38ca22e947f7cc7fcb58297e1f4ce2d36f2d52a Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Wed, 29 Jun 2016 15:16:49 +0100 Subject: [PATCH] Add a few braces for clarity --- include/pybind11/numpy.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index dc4000ba9..5fdbe6df9 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -257,12 +257,14 @@ struct npy_format_descriptor::value> pybind11_fail("NumPy: failed to create structured dtype"); auto np = module::import("numpy"); auto empty = (object) np.attr("empty"); - if (auto arr = (object) empty(int_(0), dtype())) - if (auto view = PyMemoryView_FromObject(arr.ptr())) + if (auto arr = (object) empty(int_(0), dtype())) { + if (auto view = PyMemoryView_FromObject(arr.ptr())) { if (auto info = PyMemoryView_GET_BUFFER(view)) { std::strncpy(format_(), info->format, 4096); return; } + } + } pybind11_fail("NumPy: failed to extract buffer format"); }