# HG changeset patch # User Augie Fackler # Date 1495994534 14400 # Node ID 9f56d462634cdee54abb93783505325600d3a60d # Parent 47ce079b1afa026b36478c98166608f5070cf354 cmdutil: use sorted(dict) instead of x = dict.keys(); x.sort() The former both does less work and has the virtue of working on Python 3. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -449,8 +449,7 @@ return choice[cmd] if len(choice) > 1: - clist = choice.keys() - clist.sort() + clist = sorted(choice) raise error.AmbiguousCommand(cmd, clist) if choice: