diff --git a/IPython/utils/process.py b/IPython/utils/process.py index 6c66335..d9aab85 100644 --- a/IPython/utils/process.py +++ b/IPython/utils/process.py @@ -43,8 +43,7 @@ def find_cmd(cmd): This function tries to determine the full path to a command line program using `which` on Unix/Linux/OS X and `win32api` on Windows. Most of the - time it will use the version that is first on the users `PATH`. If - cmd is `python` return `sys.executable`. + time it will use the version that is first on the users `PATH`. Warning, don't use this to find IPython command line programs as there is a risk you will find the wrong one. Instead find those using the @@ -59,8 +58,6 @@ def find_cmd(cmd): cmd : str The command line program to look for. """ - if cmd in ('python', os.path.basename(sys.executable)): - return os.path.abspath(sys.executable) try: path = _find_cmd(cmd).rstrip() except OSError: diff --git a/IPython/utils/tests/test_process.py b/IPython/utils/tests/test_process.py index 787e194..6e7f282 100644 --- a/IPython/utils/tests/test_process.py +++ b/IPython/utils/tests/test_process.py @@ -31,11 +31,7 @@ python = os.path.basename(sys.executable) # Tests #----------------------------------------------------------------------------- -def test_find_cmd_python(): - """Make sure we find sys.exectable for python.""" - nt.assert_equal(find_cmd(python), sys.executable) - @dec.skip_win32 def test_find_cmd_ls(): """Make sure we can find the full path to ls."""