diff mbox series

[3/3] iotests: Use Python 3 style super()

Message ID 20201027163806.290960-4-kwolf@redhat.com
State Accepted
Commit 757ae0ec5cc6849b88280e2aaca70fe5eb022a0d
Headers show
Series iotests: Fix pylint/mypy warnings on F33 | expand

Commit Message

Kevin Wolf Oct. 27, 2020, 4:38 p.m. UTC
pylint complains about the use of super with the current class and
instance as arguments in VM.__init__():

iotests.py:546:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)

No reason not to follow the advice and make it happy, so let's do this.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/iotests.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

John Snow Oct. 27, 2020, 4:48 p.m. UTC | #1
On 10/27/20 12:38 PM, Kevin Wolf wrote:
> pylint complains about the use of super with the current class and

> instance as arguments in VM.__init__():

> 

> iotests.py:546:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)

> 

> No reason not to follow the advice and make it happy, so let's do this.

> 

> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

> ---

>   tests/qemu-iotests/iotests.py | 8 ++++----

>   1 file changed, 4 insertions(+), 4 deletions(-)

> 

> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py

> index 28388a0fbc..814804a4c6 100644

> --- a/tests/qemu-iotests/iotests.py

> +++ b/tests/qemu-iotests/iotests.py

> @@ -543,10 +543,10 @@ class VM(qtest.QEMUQtestMachine):

>   

>       def __init__(self, path_suffix=''):

>           name = "qemu%s-%d" % (path_suffix, os.getpid())

> -        super(VM, self).__init__(qemu_prog, qemu_opts, name=name,

> -                                 test_dir=test_dir,

> -                                 socket_scm_helper=socket_scm_helper,

> -                                 sock_dir=sock_dir)

> +        super().__init__(qemu_prog, qemu_opts, name=name,

> +                         test_dir=test_dir,

> +                         socket_scm_helper=socket_scm_helper,

> +                         sock_dir=sock_dir)

>           self._num_drives = 0

>   

>       def add_object(self, opts):

> 


Reviewed-by: John Snow <jsnow@redhat.com>
Philippe Mathieu-Daudé Oct. 28, 2020, 9:31 a.m. UTC | #2
On 10/27/20 5:38 PM, Kevin Wolf wrote:
> pylint complains about the use of super with the current class and

> instance as arguments in VM.__init__():

> 

> iotests.py:546:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)

> 

> No reason not to follow the advice and make it happy, so let's do this.

> 

> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

> ---

>  tests/qemu-iotests/iotests.py | 8 ++++----

>  1 file changed, 4 insertions(+), 4 deletions(-)


Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 28388a0fbc..814804a4c6 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -543,10 +543,10 @@  class VM(qtest.QEMUQtestMachine):
 
     def __init__(self, path_suffix=''):
         name = "qemu%s-%d" % (path_suffix, os.getpid())
-        super(VM, self).__init__(qemu_prog, qemu_opts, name=name,
-                                 test_dir=test_dir,
-                                 socket_scm_helper=socket_scm_helper,
-                                 sock_dir=sock_dir)
+        super().__init__(qemu_prog, qemu_opts, name=name,
+                         test_dir=test_dir,
+                         socket_scm_helper=socket_scm_helper,
+                         sock_dir=sock_dir)
         self._num_drives = 0
 
     def add_object(self, opts):