MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / path_without_tool

Function path_without_tool

test/test_sanity.py:103–115  ·  view source on GitHub ↗
(env_path, tool_bin)

Source from the content-addressed store, hash-verified

101
102# Return a new PATH that has no directories that would contain the given tool.
103def path_without_tool(env_path, tool_bin):
104 tool_bin = exe_suffix(tool_bin)
105 python_path = os.path.normpath(os.path.dirname(sys.executable))
106
107 def ignore_path(p):
108 # We cannot ignore a path element that contains the python executable itself, otherwise
109 # the bootstrap script will fail
110 if os.path.isfile(os.path.join(p, tool_bin)) and os.path.normpath(p) != python_path:
111 return True
112 return False
113
114 old_path = env_path.split(os.pathsep)
115 return os.pathsep.join([d for d in old_path if not ignore_path(d)])
116
117
118SANITY_MESSAGE = 'Emscripten: Running sanity checks'

Callers 3

test_firstrunMethod · 0.85

Calls 4

exe_suffixFunction · 0.90
ignore_pathFunction · 0.85
splitMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected