Show More
@@ -43,8 +43,7 def find_cmd(cmd): | |||||
43 |
|
43 | |||
44 | This function tries to determine the full path to a command line program |
|
44 | This function tries to determine the full path to a command line program | |
45 | using `which` on Unix/Linux/OS X and `win32api` on Windows. Most of the |
|
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`. |
|
46 | time it will use the version that is first on the users `PATH`. | |
47 | cmd is `python` return `sys.executable`. |
|
|||
48 |
|
47 | |||
49 | Warning, don't use this to find IPython command line programs as there |
|
48 | Warning, don't use this to find IPython command line programs as there | |
50 | is a risk you will find the wrong one. Instead find those using the |
|
49 | is a risk you will find the wrong one. Instead find those using the | |
@@ -59,8 +58,6 def find_cmd(cmd): | |||||
59 | cmd : str |
|
58 | cmd : str | |
60 | The command line program to look for. |
|
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 | try: |
|
61 | try: | |
65 | path = _find_cmd(cmd).rstrip() |
|
62 | path = _find_cmd(cmd).rstrip() | |
66 | except OSError: |
|
63 | except OSError: |
@@ -31,11 +31,7 python = os.path.basename(sys.executable) | |||||
31 | # Tests |
|
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 | @dec.skip_win32 |
|
35 | @dec.skip_win32 | |
40 | def test_find_cmd_ls(): |
|
36 | def test_find_cmd_ls(): | |
41 | """Make sure we can find the full path to ls.""" |
|
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