[PATCH 3 of 9 pyflakes] filemerge: avoid shadowing a variable in a list comprehension

Yuya Nishihara yuya at tcha.org
Sun Nov 13 06:33:39 EST 2016


On Thu, 10 Nov 2016 16:52:26 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1478813587 18000
> #      Thu Nov 10 16:33:07 2016 -0500
> # Node ID 87382e400db545de30015c477a16e682d8ef36c3
> # Parent  77dce11c461ed9d6668fbbe6ff2ea1149ded4e94
> filemerge: avoid shadowing a variable in a list comprehension
> 
> diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
> --- a/mercurial/filemerge.py
> +++ b/mercurial/filemerge.py
> @@ -189,7 +189,7 @@ def _picktool(repo, ui, path, binary, sy
>          if _toolbool(ui, t, "disabled", False):
>              disabled.add(t)
>      names = tools.keys()
> -    tools = sorted([(-p, t) for t, p in tools.items() if t not in disabled])
> +    tools = sorted([(-p, tool) for tool, p in tools.items() if tool not in disabled])

check-code says line too long. Fixed in flight.


More information about the Mercurial-devel mailing list