diff options
author | Mike Frysinger <vapier@google.com> | 2019-06-13 02:13:23 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2019-06-13 13:39:25 +0000 |
commit | 31067c0ac583af2304ffe52c11df8b14c6162502 (patch) | |
tree | de1841787de87b13af60d9dd470d2544440c32d4 /subcmds/info.py | |
parent | 35159abbebf5453d4c9e89e570b891fb3d6c93cc (diff) | |
download | git-repo-31067c0ac583af2304ffe52c11df8b14c6162502.tar.gz |
tweak raise/dict syntax for Python 3 compat
Use the `raise` statement directly.
Switch to using .items() instead of .iteritems(). Python 3 doesn't
have .iteritems() as .items() is a generator, and these are small
enough that the Python 2 overhead should be negligible.
We have to run .keys() through list() in a few places as Python 3
uses a generator and we sometimes want to iterate more than once.
That's why we don't change all .keys() or .items() calls -- most
are in places where generators are fine.
Bug: https://crbug.com/gerrit/10418
Change-Id: I469899d9b77ffd77ccabb831bc4b217407fefe6f
Diffstat (limited to 'subcmds/info.py')
-rw-r--r-- | subcmds/info.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/subcmds/info.py b/subcmds/info.py index f2827b34..2fff3acc 100644 --- a/subcmds/info.py +++ b/subcmds/info.py | |||
@@ -99,7 +99,7 @@ class Info(PagedCommand): | |||
99 | self.headtext(p.revisionExpr) | 99 | self.headtext(p.revisionExpr) |
100 | self.out.nl() | 100 | self.out.nl() |
101 | 101 | ||
102 | localBranches = p.GetBranches().keys() | 102 | localBranches = list(p.GetBranches().keys()) |
103 | self.heading("Local Branches: ") | 103 | self.heading("Local Branches: ") |
104 | self.redtext(str(len(localBranches))) | 104 | self.redtext(str(len(localBranches))) |
105 | if len(localBranches) > 0: | 105 | if len(localBranches) > 0: |