URL: https://github.com/freeipa/freeipa/pull/1487 Author: tiran Title: #1487: Fix pylint error in ipapython/dn.py Action: opened
PR body: """ ipapython/dn.py:1324: [R1710(inconsistent-return-statements), DN.__contains__] Either all return statements in a function should return an expression, or none of them should.) Signed-off-by: Christian Heimes <chei...@redhat.com> Manual backport of PR #1486 to speed things up. """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/1487/head:pr1487 git checkout pr1487
From 89081c7e1a7a8aad86348cf63cbaf7c1de4ff698 Mon Sep 17 00:00:00 2001 From: Christian Heimes <chei...@redhat.com> Date: Tue, 23 Jan 2018 14:12:33 +0100 Subject: [PATCH] Fix pylint error in ipapython/dn.py ipapython/dn.py:1324: [R1710(inconsistent-return-statements), DN.__contains__] Either all return statements in a function should return an expression, or none of them should.) Signed-off-by: Christian Heimes <chei...@redhat.com> --- ipapython/dn.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ipapython/dn.py b/ipapython/dn.py index 9499096f45..9645753da1 100644 --- a/ipapython/dn.py +++ b/ipapython/dn.py @@ -1320,9 +1320,11 @@ def _tailmatch(self, pattern, start, end, direction): return not self._cmp_sequence(pattern, start, pat_len) return 0 - def __contains__(self, other): - 'Return the outcome of the test other in self. Note the reversed operands.' + """Return the outcome of the test other in self. + + Note the reversed operands. + """ if isinstance(other, RDN): other = DN(other) @@ -1336,9 +1338,9 @@ def __contains__(self, other): return True i += 1 return False - else: - raise TypeError("expected DN or RDN but got %s" % (other.__class__.__name__)) - + raise TypeError( + "expected DN or RDN but got %s" % other.__class__.__name__ + ) def find(self, pattern, start=None, end=None): '''
_______________________________________________ FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org