# HG changeset patch # User Alejandro Santos # Date 1246784731 -7200 # Node ID 8e34f363dd773912bd14ed4743598fdd2323ca95 # Parent 8429062de8d3f09a77720720ddd830cfe076236c compat: don't reference an exception var inside a lambda 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