diff --git a/gitc_utils.py b/gitc_utils.py index 0d4a5c38..f49f7be6 100644 --- a/gitc_utils.py +++ b/gitc_utils.py @@ -58,8 +58,8 @@ def _set_project_revisions(projects): sys.exit(1) revisionExpr = gitcmd.stdout.split('\t')[0] if not revisionExpr: - raise(ManifestParseError('Invalid SHA-1 revision project %s (%s)' % - (proj.remote.url, proj.revisionExpr))) + raise ManifestParseError('Invalid SHA-1 revision project %s (%s)' % + (proj.remote.url, proj.revisionExpr)) proj.revisionExpr = revisionExpr def _manifest_groups(manifest): @@ -87,7 +87,7 @@ def generate_gitc_manifest(gitc_manifest, manifest, paths=None): print('Generating GITC Manifest by fetching revision SHAs for each ' 'project.') if paths is None: - paths = manifest.paths.keys() + paths = list(manifest.paths.keys()) groups = [x for x in re.split(r'[,\s]+', _manifest_groups(manifest)) if x] @@ -96,7 +96,7 @@ def generate_gitc_manifest(gitc_manifest, manifest, paths=None): projects = [p for p in projects if p.MatchesGroups(groups)] if gitc_manifest is not None: - for path, proj in manifest.paths.iteritems(): + for path, proj in manifest.paths.items(): if not proj.MatchesGroups(groups): continue @@ -124,7 +124,7 @@ def generate_gitc_manifest(gitc_manifest, manifest, paths=None): index += NUM_BATCH_RETRIEVE_REVISIONID if gitc_manifest is not None: - for path, proj in gitc_manifest.paths.iteritems(): + for path, proj in gitc_manifest.paths.items(): if proj.old_revision and path in paths: # If we updated a project that has been started, keep the old-revision # updated. @@ -133,7 +133,7 @@ def generate_gitc_manifest(gitc_manifest, manifest, paths=None): repo_proj.revisionExpr = None # Convert URLs from relative to absolute. - for _name, remote in manifest.remotes.iteritems(): + for _name, remote in manifest.remotes.items(): remote.fetchUrl = remote.resolvedFetchUrl # Save the manifest. 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] 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): self.headtext(p.revisionExpr) self.out.nl() - localBranches = p.GetBranches().keys() + localBranches = list(p.GetBranches().keys()) self.heading("Local Branches: ") self.redtext(str(len(localBranches))) if len(localBranches) > 0: