Salome HOME
bos #20588 EDF 22731 - python command of load script
authorvsr <vsr@opencascade.com>
Thu, 21 Jan 2021 10:58:21 +0000 (13:58 +0300)
committervsr <vsr@opencascade.com>
Thu, 21 Jan 2021 10:58:21 +0000 (13:58 +0300)
src/SalomeApp/SalomeApp_Application.cxx

index b5a6c6a546e65cf563a09873646b7caaed8fb4a9..bfb209efa370c4ea8660a88c7c3e3346e2f661ac 100644 (file)
@@ -1000,7 +1000,7 @@ void SalomeApp_Application::onLoadScript( )
   if ( !aFile.isEmpty() )
   {
 
-    QString command = QString("exec(open(\"%1\", \"rb\").read())").arg(aFile);
+    QString command = QString("exec(compile(open('%1', 'rb').read(), '%1', 'exec'))").arg(aFile);
 
 #ifndef DISABLE_PYCONSOLE
     PyConsole_Console* pyConsole = pythonConsole();