Skip to content

Commit 676e51a

Browse files
authored
Merge pull request #3024 from pre-commit/pick-shebang-path-without-spaces
use sys.executable instead of echo.exe in parse_shebang
2 parents 19aa121 + 997ea0a commit 676e51a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/parse_shebang_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,17 @@ def test_normalize_cmd_PATH():
133133

134134

135135
def test_normalize_cmd_shebang(in_tmpdir):
136-
echo = _echo_exe().replace(os.sep, '/')
137-
path = write_executable(echo)
138-
assert parse_shebang.normalize_cmd((path,)) == (echo, path)
136+
us = sys.executable.replace(os.sep, '/')
137+
path = write_executable(us)
138+
assert parse_shebang.normalize_cmd((path,)) == (us, path)
139139

140140

141141
def test_normalize_cmd_PATH_shebang_full_path(in_tmpdir):
142-
echo = _echo_exe().replace(os.sep, '/')
143-
path = write_executable(echo)
142+
us = sys.executable.replace(os.sep, '/')
143+
path = write_executable(us)
144144
with bin_on_path():
145145
ret = parse_shebang.normalize_cmd(('run',))
146-
assert ret == (echo, os.path.abspath(path))
146+
assert ret == (us, os.path.abspath(path))
147147

148148

149149
def test_normalize_cmd_PATH_shebang_PATH(in_tmpdir):

0 commit comments

Comments
 (0)