:param value str: the value to append to key
:param sep str: the separator string
"""
- if src.architecture.is_windows():
- separators = [';']
- else:
- separators = [':']
- for c in separators: # windows or linux path separators
- isOK = True
- if c in value and not src.architecture.is_windows():
- isOK = False
- elif c in value and src.architecture.is_windows() and value.count(':') > 1:
- isOK = False
- if not isOK:
- 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)
:param value str: the value to prepend to key
:param sep str: the separator string
"""
- if src.architecture.is_windows():
- separators = [';']
- else:
- separators = [':']
- for c in separators: # windows or linux path separators
- isOK = True
- if c in value and not src.architecture.is_windows():
- isOK = False
- elif c in value and src.architecture.is_windows() and value.count(':') > 1:
- isOK = False
- if not isOK:
- 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)