From e4556bca1dad0edc53cb416cd98f1a6cf89c10ab Mon Sep 17 00:00:00 2001 From: DUC ANH HOANG Date: Tue, 28 Jan 2020 11:32:53 +0100 Subject: [PATCH] Minor correction to appli_gen.py: fix to prevent bugs in the future --- bin/appli_gen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/appli_gen.py b/bin/appli_gen.py index 504d8dc4f..ceb5bfa00 100755 --- a/bin/appli_gen.py +++ b/bin/appli_gen.py @@ -325,8 +325,8 @@ def install(prefix, config_file, verbose=0): # Create environment file: configSalome.sh - cmd='source %s;python -c "import sys ; sys.stdout.write(\\"{}.{}\\".format(sys.version_info.major,sys.version_info.minor))"' %(_config["prereq_path"]) - versionPython=subprocess.check_output(['/bin/bash', '-l' ,'-c',cmd]) + cmd='source %s && python3 -c "import sys ; sys.stdout.write(\\"{}.{}\\".format(sys.version_info.major,sys.version_info.minor))"' %(_config["prereq_path"]) + versionPython=subprocess.check_output(['/bin/bash', '-l' ,'-c',cmd]).decode("utf-8") with open(os.path.join(home_dir, 'env.d', 'configSalome.sh'),'w') as f: for module in _config.get("modules", []): @@ -344,7 +344,7 @@ def install(prefix, config_file, verbose=0): export PYTHONPATH=${HOME}/${APPLI}/lib/python%s/site-packages/salome:$PYTHONPATH export PYTHONPATH=${HOME}/${APPLI}/lib/salome:$PYTHONPATH export LD_LIBRARY_PATH=${HOME}/${APPLI}/lib/salome:$LD_LIBRARY_PATH -""" %versionPython.decode("utf-8") +""" %versionPython f.write(command) # Create environment variable for the salome test for module in _config.get("modules", []): @@ -371,7 +371,7 @@ export LD_LIBRARY_PATH=${HOME}/${APPLI}/lib/salome:$LD_LIBRARY_PATH ADD_TO_PYTHONPATH: ${HOME}/${APPLI}/lib/python%s/site-packages/salome ADD_TO_PYTHONPATH: ${HOME}/${APPLI}/lib/salome ADD_TO_LD_LIBRARY_PATH: ${HOME}/${APPLI}/lib/salome -"""%versionPython.decode("utf-8") +"""%versionPython f.write(command) for module in _config.get("modules", []): command = "ADD_TO_LD_LIBRARY_PATH: ${HOME}/${APPLI}/bin/salome/test/" + module + "/lib\n" -- 2.39.2