diff --git a/nifty_gridder.cc b/nifty_gridder.cc
index 4506700801e6fcd6a67da86f66e54a69db1194e1..bb2b313130ac807c11bae20341657f2d449d0e1d 100644
--- a/nifty_gridder.cc
+++ b/nifty_gridder.cc
@@ -171,7 +171,7 @@ void checkArray(const py::array &arr, const char *aname,
 template<typename T> pyarr<T> provideArray(py::object &in,
   const vector<size_t> &shape)
   {
-  if (in.is(None))
+  if (in.is_none())
     {
     auto tmp_ = makeArray<T>(shape);
     size_t sz = size_t(tmp_.size());
@@ -188,7 +188,7 @@ template<typename T> pyarr<T> provideArray(py::object &in,
 template<typename T> pyarr_c<T> provideCArray(py::object &in,
   const vector<size_t> &shape)
   {
-  if (in.is(None))
+  if (in.is_none())
     {
     auto tmp_ = makeArray<T>(shape);
     size_t sz = size_t(tmp_.size());