Fix "list comprehension redefines 'x'" warnings from pyflakes

$ git ls-files | grep py$ | xargs pyflakes
  subcmds/stage.py:101: list comprehension redefines 'p' from line 63
  subcmds/sync.py:784: list comprehension redefines 'p' from line 664
  subcmds/upload.py:467: list comprehension redefines 'avail' from line 454

Change-Id: Ia65d1a72ed185ab3357e1a91ed4450c719e75a7c
This commit is contained in:
David Pursehouse 2017-07-10 22:42:22 +09:00
parent 224a31a765
commit 3bcd30545e
3 changed files with 6 additions and 6 deletions

View File

@ -60,8 +60,8 @@ The '%prog' command stages files to prepare the next commit.
out.nl() out.nl()
for i in range(len(all_projects)): for i in range(len(all_projects)):
p = all_projects[i] project = all_projects[i]
out.write('%3d: %s', i + 1, p.relpath + '/') out.write('%3d: %s', i + 1, project.relpath + '/')
out.nl() out.nl()
out.nl() out.nl()

View File

@ -780,8 +780,8 @@ later is required to fix a server side protocol bug.
# generate a new args list to represent the opened projects. # generate a new args list to represent the opened projects.
# TODO: make this more reliable -- if there's a project name/path overlap, # TODO: make this more reliable -- if there's a project name/path overlap,
# this may choose the wrong project. # this may choose the wrong project.
args = [os.path.relpath(self.manifest.paths[p].worktree, os.getcwd()) args = [os.path.relpath(self.manifest.paths[path].worktree, os.getcwd())
for p in opened_projects] for path in opened_projects]
if not args: if not args:
return return
all_projects = self.GetProjects(args, all_projects = self.GetProjects(args,

View File

@ -464,8 +464,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
self.manifest.topdir, self.manifest.topdir,
self.manifest.manifestProject.GetRemote('origin').url, self.manifest.manifestProject.GetRemote('origin').url,
abort_if_user_denies=True) abort_if_user_denies=True)
pending_proj_names = [project.name for (project, avail) in pending] pending_proj_names = [project.name for (project, available) in pending]
pending_worktrees = [project.worktree for (project, avail) in pending] pending_worktrees = [project.worktree for (project, available) in pending]
try: try:
hook.Run(opt.allow_all_hooks, project_list=pending_proj_names, hook.Run(opt.allow_all_hooks, project_list=pending_proj_names,
worktree_list=pending_worktrees) worktree_list=pending_worktrees)