[PATCH v2 6/6] python/machine: disable warning for Popen in _launch()

John Snow posted 6 patches 4 years, 8 months ago
Maintainers: Cleber Rosa <crosa@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, John Snow <jsnow@redhat.com>
[PATCH v2 6/6] python/machine: disable warning for Popen in _launch()
Posted by John Snow 4 years, 8 months ago
We handle this resource rather meticulously in
shutdown/kill/wait/__exit__ et al, through the laborious mechanisms in
_do_shutdown().

Quiet this pylint warning here.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/qemu/machine.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index f021127f0fc..06058d89e83 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -407,6 +407,9 @@ def _launch(self) -> None:
                   self._args)
         )
         LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args))
+
+        # Cleaning up of this subprocess is guaranteed by _do_shutdown.
+        # pylint: disable=consider-using-with
         self._popen = subprocess.Popen(self._qemu_full_args,
                                        stdin=subprocess.DEVNULL,
                                        stdout=self._qemu_log_file,
-- 
2.30.2


Re: [PATCH v2 6/6] python/machine: disable warning for Popen in _launch()
Posted by Cleber Rosa 4 years, 8 months ago
On Mon, May 17, 2021 at 02:48:08PM -0400, John Snow wrote:
> We handle this resource rather meticulously in
> shutdown/kill/wait/__exit__ et al, through the laborious mechanisms in
> _do_shutdown().
> 
> Quiet this pylint warning here.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/qemu/machine.py | 3 +++
>  1 file changed, 3 insertions(+)
>

Reviewed-by: Cleber Rosa <crosa@redhat.com>