From cca842065fd2bb93bae7ed6c32a7de16b06f94d9 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 3 Dec 2020 08:45:59 +0300 Subject: [PATCH] #19007 [CEA][Windows] SALOME non regression tests on Windows: fix KERNEL_SALOME_COMMAND_TestLauncherSessionArgs test --- bin/setenv.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/bin/setenv.py b/bin/setenv.py index a6798e144..2fc8b06d3 100755 --- a/bin/setenv.py +++ b/bin/setenv.py @@ -39,28 +39,21 @@ salome_subdir = "salome" def add_path(directory, variable_name): """Function helper to add environment variables""" - if sys.platform == "win32": - splitsym = ";" - else: - splitsym = ":" if variable_name not in os.environ: os.environ[variable_name] = "" pass if os.path.exists(directory): newpath=[] - for _dir in os.environ[variable_name].split(splitsym): + for _dir in os.environ[variable_name].split(os.pathsep): if os.path.exists(_dir): - if sys.platform != "win32": - if not os.path.samefile(_dir, directory): - newpath.append(_dir) - else: + if not os.path.samefile(_dir, directory): newpath.append(_dir) else: if os.path.abspath(_dir) != os.path.abspath(directory): newpath.append(_dir) pass newpath[:0] = [ directory ] - newpath = splitsym.join(newpath) + newpath = os.pathsep.join(newpath) os.environ[variable_name] = newpath if variable_name == "PYTHONPATH": sys.path[:0] = [os.path.realpath(directory)] -- 2.39.2