Address inconsistent-return-statements

Pylint warns about inconsistent return statements when some paths of a
function return None implicitly. Make all implicit returns either
explicit or raise a proper exception.

See: https://pagure.io/freeipa/issue/7758
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Christian Heimes
2018-11-09 11:13:38 +01:00
parent 8944458d3c
commit 85286beb5b
9 changed files with 18 additions and 6 deletions

View File

@@ -206,6 +206,8 @@ class test_Command(ClassChecker):
def __call__(self, _, value):
if value != self.name:
return _('must equal %r') % self.name
else:
return None
default_from = parameters.DefaultFrom(
lambda arg: arg,