Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1492cd

Browse files
committed
fix test_find_cmd_python
It's a bit unclear what should be done here. 'python' is short-circuited in find_cmd to sys.executable. This commit does the same short-circuit with basename(sys.executable), which can be any of Python, python, python3, python3.exe, etc. An alternate fix would be to change the test back to testing what the code actually did.
1 parent b82bef4 commit a1492cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

IPython/utils/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def find_cmd(cmd):
5959
cmd : str
6060
The command line program to look for.
6161
"""
62-
if cmd == 'python':
62+
if cmd in ('python', os.path.basename(sys.executable)):
6363
return os.path.abspath(sys.executable)
6464
try:
6565
path = _find_cmd(cmd).rstrip()

0 commit comments

Comments
 (0)