Salome HOME
Copyright update 2022
[modules/gui.git] / src / Plot2d / Plot2d_AnalyticalParser.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 09f963b..89e3fac
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -58,13 +58,13 @@ namespace {
   static PyMethodDef PyStdOut_methods[] = {
     {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
       PyDoc_STR("write(string) -> None")},
-    {NULL,    NULL}   /* sentinel */
+    {0, 0, 0, 0}   /* sentinel */
   };
 
   static PyMemberDef PyStdOut_memberlist[] = {
     {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
      (char*)"flag indicating that a space needs to be printed; used by print"},
-    {NULL} /* Sentinel */
+    {0, 0, 0, 0, 0}   /* sentinel */
   };
 
   static PyTypeObject PyStdOut_Type = {
@@ -182,7 +182,7 @@ int Plot2d_AnalyticalParser::calculate( const QString& theExpr,
   aPyScript = aPyScript.arg(theExpr);
   int result = -1;
   PyGILState_STATE gstate = PyGILState_Ensure();
-  PyObject* obj = PyRun_String(qPrintable(aPyScript), Py_file_input, myMainDict, NULL);
+  PyObject* obj = PyRun_String(qUtf8Printable(aPyScript), Py_file_input, myMainDict, NULL);
 
   if(obj == NULL) {
     PyErr_Print();