Salome HOME
Merge branch 'ng780475/scs13189_windows'
[tools/sat.git] / src / environment.py
index 41ec7e5394d75b5d3fa63457664c5567cf22bb95..20a5c1eb95dc0b4f6a58873ffa657305a57909d0 100644 (file)
@@ -73,9 +73,11 @@ class Environ:
         :param value str: the value to append to key
         :param sep str: the separator string
         """
-        for c in [";", ":"]: # windows or linux path separators
-          if c in value:
-            raise Exception("Environ append key '%s' value '%s' contains forbidden character '%s'" % (key, value, c))
+        # check that value so no contain the system separator
+        separator=os.pathsep
+        if separator in value:
+            raise Exception("Environ append key '%s' value '%s' contains forbidden character '%s'" % (key, value, separator))
+
         # check if the key is already in the environment
         if key in self.environ:
             value_list = self.environ[key].split(sep)
@@ -111,9 +113,11 @@ class Environ:
         :param value str: the value to prepend to key
         :param sep str: the separator string
         """
-        for c in [";", ":"]: # windows or linux path separators
-          if c in value:
-            raise Exception("Environ prepend key '%s' value '%s' contains forbidden character '%s'" % (key, value, c))
+        # check that value so no contain the system separator
+        separator=os.pathsep
+        if separator in value:
+            raise Exception("Environ append key '%s' value '%s' contains forbidden character '%s'" % (key, value, separator))
+
         # check if the key is already in the environment
         if key in self.environ:
             value_list = self.environ[key].split(sep)
@@ -499,11 +503,11 @@ class SalomeEnviron:
                     self.prepend('LD_LIBRARY_PATH', lib_path)
 
             l = [ bin_path, lib_path ]
-            if self.has_python:
-                l.append(pylib1_path)
-                l.append(pylib2_path)
-
-            self.prepend('PYTHONPATH', l)
+            if not src.product.product_is_wheel(pi):
+                if self.has_python:
+                    l.append(pylib1_path)
+                    l.append(pylib2_path)
+                self.prepend('PYTHONPATH', l)
 
     def set_cpp_env(self, product_info):
         """\