Salome HOME
Merge remote-tracking branch 'origin/V8_3_BR' into ngr/python3_dev
authorGilles DAVID <gilles-g.david@edf.fr>
Tue, 18 Apr 2017 13:23:17 +0000 (15:23 +0200)
committerGilles DAVID <gilles-g.david@edf.fr>
Tue, 18 Apr 2017 13:23:17 +0000 (15:23 +0200)
1  2 
src/LightApp/LightApp_Application.cxx
tools/CurvePlot/src/python/views/XYView.py
tools/PyInterp/src/PyInterp_Interp.cxx

Simple merge
index d457b4cfcba822bb50d7081eb7899c04c701a73e,42ad149ece2560b15b8c9d61debbe980d7a5d989..ba3ca573148c3977f275c86af9847e1d47c43655
@@@ -688,15 -688,15 +688,15 @@@ class XYView(View)
      #  point = event.canvas.mapToGlobal(QtCore.QPoint(event.x,canvasSize.height()-event.y))
      #  self._popupMenu.move(point)
      #  self._popupMenu.show()
-    
    def onMotionEvent(self, event):
 -    print "OnMotionEvent ",event.button
 +    print("OnMotionEvent ",event.button)
      #if event.button == 3 :
      #  event.button = None
      #  return True
-    
    def onReleaseEvent(self, event):
 -    print "OnReleaseEvent ",event.button
 +    print("OnReleaseEvent ",event.button)
      #if event.button == 3 :
      #  event.button = None
      #  return False
index 27703c2a010cf94a6e927a1659d28893d35eb055,200649073b1b9596541e719825ed09b1b153d990..1caeece65800fefec8a54e01c1a29c13f06eb593
@@@ -242,19 -242,12 +242,19 @@@ void PyInterp_Interp::initPython(
  {
    if (!Py_IsInitialized()){
      // Python is not initialized
 -    Py_SetProgramName(_argv[0]);
 +    wchar_t **changed_argv = new wchar_t*[_argc]; // Setting arguments
 +    size_t mbslen;
 +    for (int i = 0; i < _argc; i++)
 +    {
 +      changed_argv[i] = Py_DecodeLocale(_argv[i], NULL);
 +    }
 +   
 +    Py_SetProgramName(changed_argv[0]);
      Py_Initialize(); // Initialize the interpreter
 -    PySys_SetArgv(_argc, _argv);
 +    PySys_SetArgv(_argc, changed_argv);
  
      PyEval_InitThreads(); // Create (and acquire) the Python global interpreter lock (GIL)
-     PyEval_ReleaseLock();
+     PyEval_SaveThread(); // release safely GIL
    }
  }