Show More
@@ -43,8 +43,7 b' def find_cmd(cmd):' | |||
|
43 | 43 | |
|
44 | 44 | This function tries to determine the full path to a command line program |
|
45 | 45 | using `which` on Unix/Linux/OS X and `win32api` on Windows. Most of the |
|
46 |
time it will use the version that is first on the users `PATH`. |
|
|
47 | cmd is `python` return `sys.executable`. | |
|
46 | time it will use the version that is first on the users `PATH`. | |
|
48 | 47 | |
|
49 | 48 | Warning, don't use this to find IPython command line programs as there |
|
50 | 49 | is a risk you will find the wrong one. Instead find those using the |
@@ -59,8 +58,6 b' def find_cmd(cmd):' | |||
|
59 | 58 | cmd : str |
|
60 | 59 | The command line program to look for. |
|
61 | 60 | """ |
|
62 | if cmd in ('python', os.path.basename(sys.executable)): | |
|
63 | return os.path.abspath(sys.executable) | |
|
64 | 61 | try: |
|
65 | 62 | path = _find_cmd(cmd).rstrip() |
|
66 | 63 | except OSError: |
@@ -31,11 +31,7 b' python = os.path.basename(sys.executable)' | |||
|
31 | 31 | # Tests |
|
32 | 32 | #----------------------------------------------------------------------------- |
|
33 | 33 | |
|
34 | def test_find_cmd_python(): | |
|
35 | """Make sure we find sys.exectable for python.""" | |
|
36 | nt.assert_equal(find_cmd(python), sys.executable) | |
|
37 | 34 | |
|
38 | ||
|
39 | 35 | @dec.skip_win32 |
|
40 | 36 | def test_find_cmd_ls(): |
|
41 | 37 | """Make sure we can find the full path to ls.""" |
General Comments 0
You need to be logged in to leave comments.
Login now