original_docstring: Remove GRASS version related variables from the environment.
docstring: Remove GRASS version related variables from the environment.
docstring_tokens: Remove GRASS version related variables from the environment .
code: def clean_grass_path_env(gisbase=None, env=None, grassbin=None):
      """Remove GRASS version related variables from the environment."""
      env = os.environ if env is None else env
      gisbase = gisbase if gisbase else get_grass_gisbase(grassbin=grassbin)
  
      grass_bin = os.path.join(gisbase, "bin")
      # Remove from PATH
      env["PATH"] = env["PATH"].replace(os.pathsep + grass_bin, "")
      env["PATH"] = env["PATH"].replace(os.pathsep + os.path.join(gisbase, "scripts"), "")
  
      # Remove from LD_LIBRARY_PATH
      ld_path = os.path.join(gisbase, "lib")
      env["LD_LIBRARY_PATH"] = env["LD_LIBRARY_PATH"].replace(os.pathsep + ld_path, "")
  
      # Remove from PYTHONPATH
      grasspy = os.path.join(gisbase, "etc", "python")
      env["PYTHONPATH"] = env["PYTHONPATH"].replace(grasspy, "")
      env["PYTHONPATH"] = env["PYTHONPATH"].replace(os.pathsep + os.pathsep, os.pathsep)
      return env
code_tokens: def clean_grass_path_env ( gisbase = None , env = None , grassbin = None ) : env = os . environ if env is None else env gisbase = gisbase if gisbase else get_grass_gisbase ( grassbin = grassbin ) grass_bin = os . path . join ( gisbase , "bin" ) env [ "PATH" ] = env [ "PATH" ] . replace ( os . pathsep + grass_bin , "" ) env [ "PATH" ] = env [ "PATH" ] . replace ( os . pathsep + os . path . join ( gisbase , "scripts" ) , "" ) ld_path = os . path . join ( gisbase , "lib" ) env [ "LD_LIBRARY_PATH" ] = env [ "LD_LIBRARY_PATH" ] . replace ( os . pathsep + ld_path , "" ) grasspy = os . path . join ( gisbase , "etc" , "python" ) env [ "PYTHONPATH" ] = env [ "PYTHONPATH" ] . replace ( grasspy , "" ) env [ "PYTHONPATH" ] = env [ "PYTHONPATH" ] . replace ( os . pathsep + os . pathsep , os . pathsep ) return env
short_docstring: Remove GRASS version related variables from the environment.
short_docstring_tokens: Remove GRASS version related variables from the environment .
comment: """Remove GRASS version related variables from the environment."""$SEP$# Remove from PATH$SEP$# Remove from LD_LIBRARY_PATH$SEP$# Remove from PYTHONPATH