# HG changeset patch # User Alejandro Santos # Date 2009-07-05 09:05:31 # Node ID 8e34f363dd773912bd14ed4743598fdd2323ca95 # Parent 8429062de8d3f09a77720720ddd830cfe076236c compat: don't reference an exception var inside a lambda diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1457,7 +1457,10 @@ def help_(ui, name=None, with_version=Fa 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