mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-11-02 20:30:26 -06:00
Fix pylint 2.0 conditional-related violations
In order to support pylint 2.0 the following violations must be fixed: - `chained-comparison` (R1716): Simplify chained comparison between the operands This message is emitted when pylint encounters boolean operation like "a < b and b < c", suggesting instead to refactor it to "a < b < c". - `consider-using-in` (R1714): Consider merging these comparisons with "in" to %r To check if a variable is equal to one of many values,combine the values into a tuple and check if the variable is contained "in" it instead of checking for equality against each of the values.This is faster and less verbose. Issue: https://pagure.io/freeipa/issue/7614 Signed-off-by: Armando Neto <abiagion@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
1 parent
f48f00c692
commit
ba954efafd
9 files changed
+12
-12
No files matched your search
+1
-1
@@ -676,7 +676,7 @@ class textui(backend.Backend):
|
||||
return -1
|
||||
try:
|
||||
selection = int(resp) - 1
|
||||
if (selection >= 0 and selection < counter):
|
||||
if (counter > selection >= 0):
|
||||
break
|
||||
except Exception:
|
||||
# fall through to the error msg
|
||||
|
||||
Reference in new issue
Block a user