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,
|
||||
consider-using-ternary,
|
||||
literal-comparison,
|
||||
consider-merging-isinstance,
|
||||
consider-merging-isinstance,
|
||||
too-many-boolean-expressions,
|
||||
useless-object-inheritance,
|
||||
trailing-comma-tuple,
|
||||
|
@ -1880,7 +1880,7 @@ def _process_model_like_filter(model, query, filters):
|
||||
if 'property' == type(column_attr).__name__:
|
||||
continue
|
||||
value = filters[key]
|
||||
if not (isinstance(value, six.string_types) or isinstance(value, int)):
|
||||
if not (isinstance(value, (six.string_types, int))):
|
||||
continue
|
||||
query = query.filter(
|
||||
column_attr.op('LIKE')(u'%%%s%%' % value))
|
||||
|
@ -315,7 +315,7 @@ class CheckOptRegistrationArgs(BaseASTChecker):
|
||||
return None
|
||||
|
||||
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):
|
||||
"""Look for the register_opt/register_opts calls."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user