diff --git a/IPython/core/inputtransformer2.py b/IPython/core/inputtransformer2.py index 949cf38..15d3f06 100644 --- a/IPython/core/inputtransformer2.py +++ b/IPython/core/inputtransformer2.py @@ -395,7 +395,10 @@ def _tr_quote2(content): def _tr_paren(content): "Translate lines escaped with a slash: /" - name, _, args = content.partition(' ') + name, _, args = content.partition(" ") + if name == "": + raise SyntaxError(f'"{ESC_SHELL}" must be followed by a callable name') + return '%s(%s)' % (name, ", ".join(args.split())) tr = { ESC_SHELL : 'get_ipython().system({!r})'.format,