Fix pylint warning
Multiple isinstance calls can be merged into one for better readability. Change-Id: Ib1a5c3e28acad1f9f13b981612422d9c4c2b4986 Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
parent
7c2086cb40
commit
68c8038434
@ -179,8 +179,6 @@ disable=
|
|||||||
redefined-argument-from-local,
|
redefined-argument-from-local,
|
||||||
consider-using-ternary,
|
consider-using-ternary,
|
||||||
literal-comparison,
|
literal-comparison,
|
||||||
consider-merging-isinstance,
|
|
||||||
consider-merging-isinstance,
|
|
||||||
too-many-boolean-expressions,
|
too-many-boolean-expressions,
|
||||||
useless-object-inheritance,
|
useless-object-inheritance,
|
||||||
trailing-comma-tuple,
|
trailing-comma-tuple,
|
||||||
|
@ -1880,7 +1880,7 @@ def _process_model_like_filter(model, query, filters):
|
|||||||
if 'property' == type(column_attr).__name__:
|
if 'property' == type(column_attr).__name__:
|
||||||
continue
|
continue
|
||||||
value = filters[key]
|
value = filters[key]
|
||||||
if not (isinstance(value, six.string_types) or isinstance(value, int)):
|
if not (isinstance(value, (six.string_types, int))):
|
||||||
continue
|
continue
|
||||||
query = query.filter(
|
query = query.filter(
|
||||||
column_attr.op('LIKE')(u'%%%s%%' % value))
|
column_attr.op('LIKE')(u'%%%s%%' % value))
|
||||||
|
@ -315,7 +315,7 @@ class CheckOptRegistrationArgs(BaseASTChecker):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def _is_list_or_tuple(self, obj):
|
def _is_list_or_tuple(self, obj):
|
||||||
return isinstance(obj, ast.List) or isinstance(obj, ast.Tuple)
|
return isinstance(obj, (ast.List, ast.Tuple))
|
||||||
|
|
||||||
def visit_Call(self, node):
|
def visit_Call(self, node):
|
||||||
"""Look for the register_opt/register_opts calls."""
|
"""Look for the register_opt/register_opts calls."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user