From da26908d9f0eed4a69be9e2a7ed406fad22150e3 Mon Sep 17 00:00:00 2001 From: Xavier Robin <xavier.robin@unibas.ch> Date: Thu, 23 May 2019 14:42:46 +0200 Subject: [PATCH] fix: SCHWED-3149 update check for None in input. Fixes the error "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()" in AddMesh. --- modules/gfx/pymod/export_primlist.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gfx/pymod/export_primlist.cc b/modules/gfx/pymod/export_primlist.cc index 8cdaf3230..f4c7fddd8 100644 --- a/modules/gfx/pymod/export_primlist.cc +++ b/modules/gfx/pymod/export_primlist.cc @@ -52,7 +52,7 @@ namespace { float* vp=reinterpret_cast<float*>(PyArray_DATA(va)); float* np=0; float* cp=0; - if(ona!=object()) { + if(!ona.is_none()) { if(!PyArray_Check(ona.ptr())) { throw Error("ona is not a numpy array"); } @@ -68,7 +68,7 @@ namespace { } np=reinterpret_cast<float*>(PyArray_DATA(na)); } - if(oca!=object()) { + if(!oca.is_none()) { if(!PyArray_Check(oca.ptr())) { throw Error("oca is not a numpy array"); } -- GitLab