diff options
Diffstat (limited to 'pylint/checkers/stdlib.py')
-rw-r--r-- | pylint/checkers/stdlib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 0e444af..af50a19 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -84,7 +84,7 @@ def _is_one_arg_pos_call(call): """Is this a call with exactly 1 argument, where that argument is positional? """ - return (isinstance(call, astroid.CallFunc) + return (isinstance(call, astroid.Call) and len(call.args) == 1 and not call.keywords) @@ -195,13 +195,13 @@ class StdlibChecker(BaseChecker): def _check_type_x_is_y(self, node, left, operator, right): """Check for expressions like type(x) == Y.""" left_func = helpers.safe_infer(left.func) - if not (isinstance(left_func, astroid.Class) + if not (isinstance(left_func, astroid.ClassDef) and left_func.qname() == TYPE_QNAME): return if operator in ('is', 'is not') and _is_one_arg_pos_call(right): right_func = helpers.safe_infer(right.func) - if (isinstance(right_func, astroid.Class) + if (isinstance(right_func, astroid.ClassDef) and right_func.qname() == TYPE_QNAME): # type(x) == type(a) right_arg = helpers.safe_infer(right.args[0]) |