From: rnv Date: Thu, 3 Dec 2020 05:45:59 +0000 (+0300) Subject: #19007 [CEA][Windows] SALOME non regression tests on Windows: fix KERNEL_SALOME_COMMA... X-Git-Tag: V9_7_0a1~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cca842065fd2bb93bae7ed6c32a7de16b06f94d9;p=modules%2Fkernel.git #19007 [CEA][Windows] SALOME non regression tests on Windows: fix KERNEL_SALOME_COMMAND_TestLauncherSessionArgs test --- 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)]