Salome HOME
Fix type mapping for Python boolean parameters rbe/fix_py_bool_params V2_3_2p1
authorRenaud Barate <renaud.barate@edf.fr>
Wed, 4 Oct 2017 13:12:21 +0000 (15:12 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Wed, 4 Oct 2017 13:12:21 +0000 (15:12 +0200)
src/Python/libBatch_Swig_typemap.i

index ca73e44c1bcfb8d8cc6e54ffe473388e21e2404b..cbd1a23e58359a482a26db8db0dfdfe31cfbfc58 100644 (file)
@@ -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;