summaryrefslogtreecommitdiff
path: root/checkers/strings.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2014-07-31 19:05:34 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2014-07-31 19:05:34 +0300
commitfef230b80e8ab0c5d27eb9e99752af5143b81fff (patch)
tree326eceac3c5720a2341317777a7e0c27b3046f49 /checkers/strings.py
parent270b6a459e4651895b4a912125ab1dcacd72b415 (diff)
downloadpylint-git-fef230b80e8ab0c5d27eb9e99752af5143b81fff.tar.gz
Analyze only strings by the string format checker. Closes issue #287.
Diffstat (limited to 'checkers/strings.py')
-rw-r--r--checkers/strings.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/checkers/strings.py b/checkers/strings.py
index 11b2baa66..9d4f13a8f 100644
--- a/checkers/strings.py
+++ b/checkers/strings.py
@@ -317,6 +317,13 @@ class StringMethodsChecker(BaseChecker):
def _check_new_format(self, node, func):
""" Check the new string formatting. """
+ # TODO: skip (for now) format nodes which don't have
+ # an explicit string on the left side of the format operation.
+ # We do this because our inference engine can't properly handle
+ # redefinitions of the original string.
+ # For more details, see issue 287.
+ if not isinstance(node.func.expr, astroid.Const):
+ return
try:
strnode = func.bound.infer().next()
except astroid.InferenceError: