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:
Armando Neto authored and Christian Heimes committed 2018-07-12 08:49:43 +02:00
1 parent f48f00c692
commit ba954efafd
9 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -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