Salome HOME
Fix type mapping for Python boolean parameters
[tools/libbatch.git] / 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;