From: Max Reitz <mreitz@redhat.com>
To: Emanuele Giuseppe Esposito <eesposit@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2] qemu-iotests: fix pylint 2.8 consider-using-with error
Date: Fri, 14 May 2021 16:09:48 +0200 [thread overview]
Message-ID: <6fe978ce-be8c-db43-120d-95cb66769bfe@redhat.com> (raw)
In-Reply-To: <d2253d8d-89dd-1acf-e005-0fb3aee6610d@redhat.com>
On 12.05.21 19:04, Max Reitz wrote:
> On 10.05.21 21:04, Emanuele Giuseppe Esposito wrote:
>> pylint 2.8 introduces consider-using-with error, suggesting
>> to use the 'with' block statement when possible.
>>
>> Modify all subprocess.Popen call to use the 'with' statement,
>> except the one in __init__ of QemuIoInteractive class, since
>> it is assigned to a class field and used in other methods.
>>
>> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
>> ---
>> v1 -> v2:
>> * fix indentation [Max]
>> * explain why we disabled the check in QemuIoInteractive's __init__ [Max]
>
> Thanks!
>
> Applied to my block branch:
>
> https://github.com/XanClic/qemu/commits/block
I’ve just seen that the “# pylint: disable=consider-using-with” line
causes a warning in pylint versions that don’t know that warning…
I’d like to squash this in:
> diff --git a/tests/qemu-iotests/pylintrc b/tests/qemu-iotests/pylintrc
> index 7a6c0a9474..f2c0b522ac 100644
> --- a/tests/qemu-iotests/pylintrc
> +++ b/tests/qemu-iotests/pylintrc
> @@ -19,6 +19,9 @@ disable=invalid-name,
> too-many-public-methods,
> # pylint warns about Optional[] etc. as unsubscriptable in 3.9
> unsubscriptable-object,
> + # Sometimes we need to disable a newly introduced pylint warning.
> + # Doing so should not produce a warning in older versions of pylint.
> + bad-option-value,
> # These are temporary, and should be removed:
> missing-docstring,
> too-many-return-statements,
Would that be OK for you?
Max
next prev parent reply other threads:[~2021-05-14 14:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 19:04 [PATCH v2] qemu-iotests: fix pylint 2.8 consider-using-with error Emanuele Giuseppe Esposito
2021-05-12 17:04 ` Max Reitz
2021-05-14 14:09 ` Max Reitz [this message]
2021-05-14 14:40 ` Emanuele Giuseppe Esposito
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6fe978ce-be8c-db43-120d-95cb66769bfe@redhat.com \
--to=mreitz@redhat.com \
--cc=eesposit@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).