From 1514403487f6e8b0a52fcb690005824d44b975c9 2015-03-26 17:16:01 From: Thomas Adriaan Hellinger Date: 2015-03-26 17:16:01 Subject: [PATCH] Fixed error stemming from mixed args and 'commented out' args --- diff --git a/IPython/core/alias.py b/IPython/core/alias.py index 903e2d7..f30d6ff 100644 --- a/IPython/core/alias.py +++ b/IPython/core/alias.py @@ -169,13 +169,12 @@ class Alias(object): if cmd.find('%l') >= 0: cmd = cmd.replace('%l', rest) rest = '' - - if cmd.find('%%s') >= 1: - cmd = cmd.replace('%%s', '%s') - + if nargs==0: - # Simple, argument-less aliases - cmd = '%s %s' % (cmd, rest) + if cmd.find('%%s') >= 1: + cmd = cmd.replace('%%s', '%s') + # Simple, argument-less aliases + cmd = '%s %s' % (cmd, rest) else: # Handle aliases with positional arguments args = rest.split(None, nargs)