From: vsr Date: Thu, 21 Jan 2021 10:58:21 +0000 (+0300) Subject: bos #20588 EDF 22731 - python command of load script X-Git-Tag: V9_7_0a1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fcc31ca09149ccb54860899e32fbe7ca668acd1f;p=modules%2Fgui.git bos #20588 EDF 22731 - python command of load script --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index b5a6c6a54..bfb209efa 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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();