summaryrefslogtreecommitdiff
path: root/pylint/checkers/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/checkers/base.py')
-rw-r--r--pylint/checkers/base.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py
index fd3f285..cd4a81e 100644
--- a/pylint/checkers/base.py
+++ b/pylint/checkers/base.py
@@ -1494,7 +1494,7 @@ class ComparisonChecker(_BasicChecker):
if isinstance(right, astroid.Const):
return
operator = REVERSED_COMPS.get(operator, operator)
- suggestion = '%s %s %s' % (right.as_string(), operator, left.value)
+ suggestion = '%s %s %r' % (right.as_string(), operator, left.value)
self.add_message('misplaced-comparison-constant', node=node,
args=(suggestion,))
@@ -1504,7 +1504,6 @@ class ComparisonChecker(_BasicChecker):
# but not 'x == y == 42'
if len(node.ops) != 1:
return
-
left = node.left
operator, right = node.ops[0]
if operator == '==':