mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -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:
committed by
Christian Heimes
parent
f48f00c692
commit
ba954efafd
@@ -113,10 +113,10 @@ class ACI(object):
|
||||
if token == "(":
|
||||
var = next(lexer).strip()
|
||||
operator = next(lexer)
|
||||
if operator != "=" and operator != "!=":
|
||||
if operator not in ("=", "!="):
|
||||
# Peek at the next char before giving up
|
||||
operator = operator + next(lexer)
|
||||
if operator != "=" and operator != "!=":
|
||||
if operator not in ("=", "!="):
|
||||
raise SyntaxError("No operator in target, got '%s'" % operator)
|
||||
op = operator
|
||||
val = next(lexer).strip()
|
||||
|
||||
Reference in New Issue
Block a user