[PATCH v3 01/15] python/qom: Do not use 'err' name at module scope

John Snow posted 15 patches 4 years, 7 months ago
Maintainers: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Eduardo Habkost <ehabkost@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Willian Rampazzo <willianr@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, John Snow <jsnow@redhat.com>, Thomas Huth <thuth@redhat.com>, Cleber Rosa <crosa@redhat.com>
[PATCH v3 01/15] python/qom: Do not use 'err' name at module scope
Posted by John Snow 4 years, 7 months ago
Pylint updated to 2.9.0 upstream, adding new warnings for things that
re-use the 'err' variable. Luckily, this only breaks the
python-check-tox job, which is allowed to fail as a warning.

Signed-off-by: John Snow <jsnow@redhat.com>

---

I guess that's good enough evidence that check-pipenv and check-tox both
have their place :)

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/qemu/qmp/qom.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/qemu/qmp/qom.py b/python/qemu/qmp/qom.py
index 7ec7843d57..8ff28a8343 100644
--- a/python/qemu/qmp/qom.py
+++ b/python/qemu/qmp/qom.py
@@ -38,8 +38,8 @@
 
 try:
     from .qom_fuse import QOMFuse
-except ModuleNotFoundError as err:
-    if err.name != 'fuse':
+except ModuleNotFoundError as _err:
+    if _err.name != 'fuse':
         raise
 else:
     assert issubclass(QOMFuse, QOMCommand)
-- 
2.31.1


Re: [PATCH v3 01/15] python/qom: Do not use 'err' name at module scope
Posted by Wainer dos Santos Moschetta 4 years, 7 months ago
On 6/29/21 6:43 PM, John Snow wrote:
> Pylint updated to 2.9.0 upstream, adding new warnings for things that
> re-use the 'err' variable. Luckily, this only breaks the
> python-check-tox job, which is allowed to fail as a warning.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
>
> ---
>
> I guess that's good enough evidence that check-pipenv and check-tox both
> have their place :)
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   python/qemu/qmp/qom.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
>
> diff --git a/python/qemu/qmp/qom.py b/python/qemu/qmp/qom.py
> index 7ec7843d57..8ff28a8343 100644
> --- a/python/qemu/qmp/qom.py
> +++ b/python/qemu/qmp/qom.py
> @@ -38,8 +38,8 @@
>   
>   try:
>       from .qom_fuse import QOMFuse
> -except ModuleNotFoundError as err:
> -    if err.name != 'fuse':
> +except ModuleNotFoundError as _err:
> +    if _err.name != 'fuse':
>           raise
>   else:
>       assert issubclass(QOMFuse, QOMCommand)


Re: [PATCH v3 01/15] python/qom: Do not use 'err' name at module scope
Posted by Willian Rampazzo 4 years, 7 months ago
On Tue, Jun 29, 2021 at 6:43 PM John Snow <jsnow@redhat.com> wrote:
>
> Pylint updated to 2.9.0 upstream, adding new warnings for things that
> re-use the 'err' variable. Luckily, this only breaks the
> python-check-tox job, which is allowed to fail as a warning.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
>
> ---
>
> I guess that's good enough evidence that check-pipenv and check-tox both
> have their place :)
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/qemu/qmp/qom.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>