[libvirt PATCH] scripts: Fix E741 that pycodesyle is pointing out during syntax-check
Michal Privoznik
mprivozn at redhat.com
Mon May 25 15:23:23 UTC 2020
On 5/25/20 2:56 PM, Erik Skultety wrote:
> With newer pycodestyle 2.6.0 (which is part of flake8-3.8.2) reports
> the following pep violation during syntax-check:
>
> ../scripts/check-remote-protocol.py:95:9: E741 ambiguous variable name 'l'
> for l in err.strip().split("\n")
>
> On all the distros we test on, this hasn't occurred yet, but with the
> future update of flake8 it likely would. The fix is easy, just name the
> variable appropriately.
>
> Signed-off-by: Erik Skultety <eskultet at redhat.com>
> ---
>
> The weird thing is that E741 checking has been in pycodestyle since 2.1.0 [1],
> we now have 2.5.0 and yet only 2.6.0 is complaining about it
> [1] https://pycodestyle.pycqa.org/en/latest/developer.html#id8
>
> scripts/check-remote-protocol.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/check-remote-protocol.py b/scripts/check-remote-protocol.py
> index 25caa19563..cf9e3f84a1 100644
> --- a/scripts/check-remote-protocol.py
> +++ b/scripts/check-remote-protocol.py
> @@ -92,8 +92,8 @@ if out == "" or pdwtagsproc.returncode != 0:
> else:
> print("WARNING: exit code %d, pdwtags appears broken:" %
> pdwtagsproc.returncode, file=sys.stderr)
> - for l in err.strip().split("\n"):
> - print("WARNING: %s" % l, file=sys.stderr)
> + for line in err.strip().split("\n"):
> + print("WARNING: %s" % line, file=sys.stderr)
> print("WARNING: skipping the remote protocol test", file=sys.stderr)
> sys.exit(0)
Ah, the error is about short variable name, it's about 'l' looking too
similar to 'I' (well, if this is somebody's case then I say use better
font if you want to code). But in order to shut the checker up:
Reviewed-by: Michal Privoznik <mprivozn at redhat.com>
Michal
More information about the libvir-list
mailing list