parameters: (environ, name, subfolder)
return_statement: return new_value if value_modified else None
docstring: For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
  
      :param subfolder: str '' or subfoldername that may start with '/'
      :returns: the updated value of the environment variable.
docstring_summary: For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
docstring_tokens: For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env [ NAME ] matching workspace + subfolder .
function: def _rollback_env_variable(environ, name, subfolder):
      '''
      For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
  
      :param subfolder: str '' or subfoldername that may start with '/'
      :returns: the updated value of the environment variable.
      '''
      value = environ[name] if name in environ else ''
      env_paths = [path for path in value.split(os.pathsep) if path]
      value_modified = False
      if subfolder:
          if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
              subfolder = subfolder[1:]
          if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)):
              subfolder = subfolder[:-1]
      for ws_path in _get_workspaces(environ, include_fuerte=True, include_non_existing=True):
          path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path
          path_to_remove = None
          for env_path in env_paths:
              env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
              if env_path_clean == path_to_find:
                  path_to_remove = env_path
                  break
          if path_to_remove:
              env_paths.remove(path_to_remove)
              value_modified = True
      new_value = os.pathsep.join(env_paths)
      return new_value if value_modified else None
function_tokens: def _rollback_env_variable ( environ , name , subfolder ) : value = environ [ name ] if name in environ else '' env_paths = [ path for path in value . split ( os . pathsep ) if path ] value_modified = False if subfolder : if subfolder . startswith ( os . path . sep ) or ( os . path . altsep and subfolder . startswith ( os . path . altsep ) ) : subfolder = subfolder [ 1 : ] if subfolder . endswith ( os . path . sep ) or ( os . path . altsep and subfolder . endswith ( os . path . altsep ) ) : subfolder = subfolder [ : - 1 ] for ws_path in _get_workspaces ( environ , include_fuerte = True , include_non_existing = True ) : path_to_find = os . path . join ( ws_path , subfolder ) if subfolder else ws_path path_to_remove = None for env_path in env_paths : env_path_clean = env_path [ : - 1 ] if env_path and env_path [ - 1 ] in [ os . path . sep , os . path . altsep ] else env_path if env_path_clean == path_to_find : path_to_remove = env_path break if path_to_remove : env_paths . remove ( path_to_remove ) value_modified = True new_value = os . pathsep . join ( env_paths ) return new_value if value_modified else None