[elbe-devel] [PATCH 10/40] pylint: fix 'function already defined' warning

Torben Hohn torben.hohn at linutronix.de
Thu Sep 20 11:22:42 CEST 2018


On Fri, Sep 14, 2018 at 01:56:22PM +0200, Manuel Traut wrote:
> the warning can be avoid if elif instead of multiple if
> statements are used.
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/daemons/soap/faults.py | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/elbepack/daemons/soap/faults.py b/elbepack/daemons/soap/faults.py
> index 1ed46e19..288d1c8f 100644
> --- a/elbepack/daemons/soap/faults.py
> +++ b/elbepack/daemons/soap/faults.py
> @@ -92,7 +92,7 @@ def soap_faults(func):
>              except Exception as e:
>                  raise SoapElbeProjectError(format_exc())
>          return wrapped
> -    if func.__code__.co_argcount == 2:
> +    elif func.__code__.co_argcount == 2:
>          @wraps(func)
>          def wrapped(self, arg1):
>              try:
> @@ -112,7 +112,7 @@ def soap_faults(func):
>              except Exception as e:
>                  raise SoapElbeProjectError(format_exc())
>          return wrapped
> -    if func.__code__.co_argcount == 3:
> +    elif func.__code__.co_argcount == 3:
>          @wraps(func)
>          def wrapped(self, arg1, arg2):
>              try:
> @@ -132,7 +132,7 @@ def soap_faults(func):
>              except Exception as e:
>                  raise SoapElbeProjectError(format_exc())
>          return wrapped
> -    if func.__code__.co_argcount == 4:
> +    elif func.__code__.co_argcount == 4:
>          @wraps(func)
>          def wrapped(self, arg1, arg2, arg3):
>              try:
> @@ -152,7 +152,7 @@ def soap_faults(func):
>              except Exception as e:
>                  raise SoapElbeProjectError(format_exc())
>          return wrapped
> -    if func.__code__.co_argcount == 5:
> +    elif func.__code__.co_argcount == 5:
>          @wraps(func)
>          def wrapped(self, arg1, arg2, arg3, arg4):
>              try:
> @@ -172,7 +172,7 @@ def soap_faults(func):
>              except Exception as e:
>                  raise SoapElbeProjectError(format_exc())
>          return wrapped
> -    if func.__code__.co_argcount == 6:
> +    elif func.__code__.co_argcount == 6:
>          @wraps(func)
>          def wrapped(self, arg1, arg2, arg3, arg4, arg5):
>              # pylint: disable=too-many-arguments
> @@ -193,7 +193,7 @@ def soap_faults(func):
>              except Exception as e:
>                  raise SoapElbeProjectError(format_exc())
>          return wrapped
> -    if func.__code__.co_argcount == 7:
> +    elif func.__code__.co_argcount == 7:
>          @wraps(func)
>          def wrapped(self, arg1, arg2, arg3, arg4, arg5, arg6):
>              # pylint: disable=too-many-arguments
> -- 
> 2.19.0.rc2
> 

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20180920/035de379/attachment.sig>


More information about the elbe-devel mailing list