diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-10-04 18:17:54 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-10-04 18:17:54 +0300 |
commit | b6d09b3c12fcf250e9d00b386bc04c5e8b8b3372 (patch) | |
tree | 401f0c37bff5f1afaa406e8355293b3dd8128b77 | |
parent | 1484e573d406ca4253ed34866f3d8377b1680e48 (diff) | |
download | pylint-b6d09b3c12fcf250e9d00b386bc04c5e8b8b3372.tar.gz |
Simplify the check.
-rw-r--r-- | pylint/checkers/base.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index ffcd34c..30e337b 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -1469,10 +1469,11 @@ class ComparisonChecker(_BasicChecker): left = node.left operator, right = node.ops[0] - if operator == '==' and isinstance(left, astroid.Const): - self.check_singleton_comparison(left, node) - elif operator == '==' and isinstance(right, astroid.Const): - self.check_singleton_comparison(right, node) + if operator == '==': + if isinstance(left, astroid.Const): + self.check_singleton_comparison(left, node) + elif isinstance(right, astroid.Const): + self.check_singleton_comparison(right, node) def register(linter): |