From 31067c0ac583af2304ffe52c11df8b14c6162502 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 13 Jun 2019 02:13:23 -0400 Subject: 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 --- subcmds/abandon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subcmds/abandon.py') diff --git a/subcmds/abandon.py b/subcmds/abandon.py index be32dc5c..f1c2a839 100644 --- a/subcmds/abandon.py +++ b/subcmds/abandon.py @@ -58,7 +58,7 @@ It is equivalent to "git branch -D ". pm.update() if opt.all: - branches = project.GetBranches().keys() + branches = list(project.GetBranches().keys()) else: branches = [nb] -- cgit v1.2.3-54-g00ecf