From efe35d517ea73ebcbb5e60c1d212220e925a32a7 2013-02-05 11:37:36 From: Robert Marchman Date: 2013-02-05 11:37:36 Subject: [PATCH] new style string formatting + explicit error message --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 4c8e973..fe42c47 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2125,7 +2125,8 @@ class InteractiveShell(SingletonConfigurable): 'did you mean that instead?)' % magic_name ) error(etpl % (magic_name, extra)) elif cell == '': - raise UsageError('%%%%%s has line but no cell' % magic_name) + raise UsageError('%%{0} (with double %) expects code beneath it. ' + 'Did you mean %{0} (single %)?'.format(magic_name)) else: # Note: this is the distance in the stack to the user's frame. # This will need to be updated if the internal calling logic gets