From 4ad1eea41d602ec8546eca6f9beeec21f9f884da 2016-08-12 06:12:41 From: anantkaushik89 Date: 2016-08-12 06:12:41 Subject: [PATCH] cleanup unused code from utils/process.py --- diff --git a/IPython/utils/process.py b/IPython/utils/process.py index a274f43..905d56a 100644 --- a/IPython/utils/process.py +++ b/IPython/utils/process.py @@ -41,6 +41,9 @@ def find_cmd(cmd): from IPython.utils.process import pycmd2argv argv = pycmd2argv(get_ipython_module_path('IPython.terminal.ipapp')) + Note, The code for pycmd2argv has been removed now as it was not used + anywhere. get_ipython_module_path should give us that same result. + Parameters ---------- cmd : str @@ -52,41 +55,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('\\','/')