From: Renaud Barate Date: Wed, 4 Oct 2017 13:12:21 +0000 (+0200) Subject: Fix type mapping for Python boolean parameters X-Git-Tag: V2_3_2p1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa8d1af7b9d1d250864a4d9724e3d098132e868b;p=tools%2Flibbatch.git Fix type mapping for Python boolean parameters --- diff --git a/src/Python/libBatch_Swig_typemap.i b/src/Python/libBatch_Swig_typemap.i index ca73e44..cbd1a23 100644 --- a/src/Python/libBatch_Swig_typemap.i +++ b/src/Python/libBatch_Swig_typemap.i @@ -68,10 +68,10 @@ static bool initVersatile(Batch::Versatile & newVersatile, PyObject * input) } else if (PyString_Check(input)) { // c'est une string newVersatile = PyString_AsString(input); - } else if (PyInt_Check(input)) { // c'est un int - newVersatile = PyInt_AsLong(input); } else if (PyBool_Check(input)) { // c'est un bool newVersatile = (input == Py_True); + } else if (PyInt_Check(input)) { // c'est un int + newVersatile = PyInt_AsLong(input); } else { // erreur PyErr_SetString(PyExc_RuntimeWarning, "initVersatile : invalid PyObject"); return false;