diff --git a/IPython/core/magics/script.py b/IPython/core/magics/script.py index 15dc30a..e1e1654 100644 --- a/IPython/core/magics/script.py +++ b/IPython/core/magics/script.py @@ -30,7 +30,7 @@ from IPython.core.magic import ( from IPython.lib.backgroundjobs import BackgroundJobManager from IPython.testing.skipdoctest import skip_doctest from IPython.utils import py3compat -from IPython.utils.process import find_cmd, FindCmdError, arg_split +from IPython.utils.process import arg_split from IPython.utils.traitlets import List, Dict #----------------------------------------------------------------------------- @@ -90,36 +90,23 @@ class ScriptMagics(Magics, Configurable): """, ) def _script_magics_default(self): - """default to a common list of programs if we find them""" + """default to a common list of programs""" - defaults = [] - to_try = [] - if os.name == 'nt': - defaults.append('cmd') - to_try.append('powershell') - to_try.extend([ + defaults = [ 'sh', 'bash', 'perl', 'ruby', + 'python', 'python3', 'pypy', - ]) + ] + if os.name == 'nt': + defaults.extend([ + 'cmd', + 'powershell', + ]) - for cmd in to_try: - if cmd in self.script_paths: - defaults.append(cmd) - else: - try: - find_cmd(cmd) - except FindCmdError: - # command not found, ignore it - pass - except ImportError: - # Windows without pywin32, find_cmd doesn't work - pass - else: - defaults.append(cmd) return defaults script_paths = Dict(config=True,