From 8a9dcaee64a77340f2c80025668cc5f08fa96ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Fri, 27 Dec 2024 16:33:38 +0000 Subject: [PATCH] style: Fix W0231: __init__ method from base class is not called (super-init-not-called) Pylint rule: https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/super-init-not-called.html --- gui/wxpython/gcp/manager.py | 1 + gui/wxpython/image2target/ii2t_manager.py | 1 + gui/wxpython/photo2image/ip2i_manager.py | 1 + pyproject.toml | 1 - python/grass/imaging/images2swf.py | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/wxpython/gcp/manager.py b/gui/wxpython/gcp/manager.py index 5b05074e638..caad8857ec7 100644 --- a/gui/wxpython/gcp/manager.py +++ b/gui/wxpython/gcp/manager.py @@ -1026,6 +1026,7 @@ def __init__( Map=None, lmgr=None, ): + # pylint: disable=super-init-not-called; See InitMapDisplay() self.grwiz = grwiz # GR Wizard self._giface = giface diff --git a/gui/wxpython/image2target/ii2t_manager.py b/gui/wxpython/image2target/ii2t_manager.py index c86564d6280..860006f8e7b 100644 --- a/gui/wxpython/image2target/ii2t_manager.py +++ b/gui/wxpython/image2target/ii2t_manager.py @@ -1003,6 +1003,7 @@ def __init__( Map=None, lmgr=None, ): + # pylint: disable=super-init-not-called; See InitMapDisplay() self.grwiz = grwiz # GR Wizard self._giface = giface diff --git a/gui/wxpython/photo2image/ip2i_manager.py b/gui/wxpython/photo2image/ip2i_manager.py index 255cb29ffd3..26bd3ed7733 100644 --- a/gui/wxpython/photo2image/ip2i_manager.py +++ b/gui/wxpython/photo2image/ip2i_manager.py @@ -308,6 +308,7 @@ def __init__( lmgr=None, camera=None, ): + # pylint: disable=super-init-not-called; See InitMapDisplay() self.grwiz = grwiz # GR Wizard self._giface = giface diff --git a/pyproject.toml b/pyproject.toml index 97885fb9523..1ff3ed1d247 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -665,7 +665,6 @@ disable = [ "W0221", # (arguments-differ) "W0222", # Signature differs from %s %r method (signature-differs) "W0223", # Method %r is abstract in class %r but is not overridden in child class %r (abstract-method) - "W0231", # __init__ method from base class %r is not called (super-init-not-called) "W0237", # (arguments-renamed) "W0401", # Wildcard import %s (wildcard-import) "W0404", # Reimport %r (imported line %s) (reimported) diff --git a/python/grass/imaging/images2swf.py b/python/grass/imaging/images2swf.py index 6a5bbacae5c..d8f93fdfc32 100644 --- a/python/grass/imaging/images2swf.py +++ b/python/grass/imaging/images2swf.py @@ -486,6 +486,7 @@ class SetBackgroundTag(ControlTag): """Set the color in 0-255, or 0-1 (if floats given).""" def __init__(self, *rgb): + super().__init__() self.tagtype = 9 if len(rgb) == 1: rgb = rgb[0]