]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
#19007 [CEA][Windows] SALOME non regression tests on Windows: fix KERNEL_SALOME_COMMA...
authorrnv <rnv@opencascade.com>
Thu, 3 Dec 2020 05:45:59 +0000 (08:45 +0300)
committerrnv <rnv@opencascade.com>
Thu, 3 Dec 2020 05:45:59 +0000 (08:45 +0300)
bin/setenv.py

index a6798e14485f19e37b89b255507421b8a43d774f..2fc8b06d302da835c7bc874bcc880bf81d94f20a 100755 (executable)
@@ -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)]