diff -r 8429062de8d3 -r 8e34f363dd77 mercurial/commands.py --- a/mercurial/commands.py Sun Jul 05 11:04:55 2009 +0200 +++ b/mercurial/commands.py Sun Jul 05 11:05:31 2009 +0200 @@ -1457,7 +1457,10 @@ try: aliases, i = cmdutil.findcmd(name, table, False) except error.AmbiguousCommand, inst: - select = lambda c: c.lstrip('^').startswith(inst.args[0]) + # py3k fix: except vars can't be used outside the scope of the + # except block, nor can be used inside a lambda. python issue4617 + prefix = inst.args[0] + select = lambda c: c.lstrip('^').startswith(prefix) helplist(_('list of commands:\n\n'), select) return