comparison mercurial/commands.py @ 9035:8e34f363dd77

compat: don't reference an exception var inside a lambda
author Alejandro Santos <alejolp@alejolp.com>
date Sun, 05 Jul 2009 11:05:31 +0200
parents 3b76321aa0de
children 32e678f9045f
comparison
equal deleted inserted replaced
9034:8429062de8d3 9035:8e34f363dd77
1455 ui.write('\n') 1455 ui.write('\n')
1456 1456
1457 try: 1457 try:
1458 aliases, i = cmdutil.findcmd(name, table, False) 1458 aliases, i = cmdutil.findcmd(name, table, False)
1459 except error.AmbiguousCommand, inst: 1459 except error.AmbiguousCommand, inst:
1460 select = lambda c: c.lstrip('^').startswith(inst.args[0]) 1460 # py3k fix: except vars can't be used outside the scope of the
1461 # except block, nor can be used inside a lambda. python issue4617
1462 prefix = inst.args[0]
1463 select = lambda c: c.lstrip('^').startswith(prefix)
1461 helplist(_('list of commands:\n\n'), select) 1464 helplist(_('list of commands:\n\n'), select)
1462 return 1465 return
1463 1466
1464 # synopsis 1467 # synopsis
1465 if len(i) > 2: 1468 if len(i) > 2: