From 413daa2e42a01d5c33ed2bc5cf41b743d31ca2a4 Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 30 Apr 2009 07:28:18 +0000 Subject: [PATCH] Fix of bug IPAL21005 - Dump/load python script works only with absolute path --- src/SalomeApp/SalomeApp_Application.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 54a4ce85c..ad7b6314f 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -785,7 +785,10 @@ void SalomeApp_Application::onLoadScript( ) if ( !aFile.isEmpty() ) { - QString command = QString("execfile(\"%1\")").arg(aFile); + QFileInfo aFileInfo( aFile ); + QString anAbsPath = aFileInfo.dirPath( true ); + QString aFileName = aFileInfo.baseName(); + QString command = QString("import sys; sys.path.insert(0,\"%1\"); import %2").arg(anAbsPath, aFileName); PythonConsole* pyConsole = pythonConsole(); -- 2.39.2