diff --git a/IPython/utils/process.py b/IPython/utils/process.py index a274f43..bdcf8ef 100644 --- a/IPython/utils/process.py +++ b/IPython/utils/process.py @@ -37,9 +37,8 @@ def find_cmd(cmd): is a risk you will find the wrong one. Instead find those using the following code and looking for the application itself:: - from IPython.utils.path import get_ipython_module_path - from IPython.utils.process import pycmd2argv - argv = pycmd2argv(get_ipython_module_path('IPython.terminal.ipapp')) + import sys + argv = [sys.executable, '-m', 'IPython'] Parameters ---------- @@ -52,41 +51,6 @@ def find_cmd(cmd): return path -def is_cmd_found(cmd): - """Check whether executable `cmd` exists or not and return a bool.""" - try: - find_cmd(cmd) - return True - except FindCmdError: - return False - - -def pycmd2argv(cmd): - r"""Take the path of a python command and return a list (argv-style). - - This only works on Python based command line programs and will find the - location of the ``python`` executable using ``sys.executable`` to make - sure the right version is used. - - For a given path ``cmd``, this returns [cmd] if cmd's extension is .exe, - .com or .bat, and [, cmd] otherwise. - - Parameters - ---------- - cmd : string - The path of the command. - - Returns - ------- - argv-style list. - """ - ext = os.path.splitext(cmd)[1] - if ext in ['.exe', '.com', '.bat']: - return [cmd] - else: - return [sys.executable, cmd] - - def abbrev_cwd(): """ Return abbreviated version of cwd, e.g. d:mydir """ cwd = py3compat.getcwd().replace('\\','/') diff --git a/docs/source/whatsnew/pr/incompat-funcs-removed.rst b/docs/source/whatsnew/pr/incompat-funcs-removed.rst new file mode 100644 index 0000000..06476a1 --- /dev/null +++ b/docs/source/whatsnew/pr/incompat-funcs-removed.rst @@ -0,0 +1,8 @@ +Functions Removed in 6.x Development cycle +------------------------------------------ + +The following functions have been removed in the +development cycle marked for Milestone 6.0. + +* IPython/utils/process.py - is_cmd_found +* IPython/utils/process.py - pycmd2argv