(env_path, tool_bin)
| 101 | |
| 102 | # Return a new PATH that has no directories that would contain the given tool. |
| 103 | def 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 | |
| 118 | SANITY_MESSAGE = 'Emscripten: Running sanity checks' |
no test coverage detected