From: Ovidiu Mircescu Date: Wed, 3 Oct 2018 14:03:28 +0000 (+0200) Subject: Improvement on porting SWIG to python3. X-Git-Tag: EMC2P_V1_1_0~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b2bc763bba5890fbd1164cc8c76e930e530b1230;p=tools%2Flibbatch.git Improvement on porting SWIG to python3. --- diff --git a/src/Python/libBatch_Swig_typemap.i b/src/Python/libBatch_Swig_typemap.i index 5e23259..35701eb 100644 --- a/src/Python/libBatch_Swig_typemap.i +++ b/src/Python/libBatch_Swig_typemap.i @@ -43,21 +43,6 @@ # %typemap(in) SWIGTYPE ; %{ -static std::string pystr2stdstr(PyObject * val) -{ - std::string str_val; - if (PyUnicode_Check(val)) - { - PyObject * temp_bytes = PyUnicode_AsEncodedString(val, "UTF-8", "strict"); - if (temp_bytes != NULL) - { - str_val = PyBytes_AS_STRING(temp_bytes); - Py_DECREF(temp_bytes); - } - } - return str_val; -} - // Helper function to initialize a Batch::Versatile from a PyObj static bool initVersatile(Batch::Versatile & newVersatile, PyObject * input) { @@ -65,13 +50,13 @@ static bool initVersatile(Batch::Versatile & newVersatile, PyObject * input) for (Py_ssize_t i=0; i