From 978617f6b548cdf15aba81fd79caacf455131e84 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Mon, 31 Jan 2022 12:57:32 -0500 Subject: [PATCH] fix issue 3668 by removing bool casts in numpy.h (#3669) --- include/pybind11/numpy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 8e83b506e..95a743ace 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -170,10 +170,10 @@ struct npy_api { } bool PyArray_Check_(PyObject *obj) const { - return (bool) PyObject_TypeCheck(obj, PyArray_Type_); + return PyObject_TypeCheck(obj, PyArray_Type_) != 0; } bool PyArrayDescr_Check_(PyObject *obj) const { - return (bool) PyObject_TypeCheck(obj, PyArrayDescr_Type_); + return PyObject_TypeCheck(obj, PyArrayDescr_Type_) != 0; } unsigned int (*PyArray_GetNDArrayCFeatureVersion_)();