summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2014-06-16 12:55:49 +0300
committercpopa <devnull@localhost>2014-06-16 12:55:49 +0300
commitd8095acce29d9d77f7e00b4be4d1b6aaf9a6c7c3 (patch)
tree4c7b51159dd05aebbd9f43fc692c57b2514e1563
parent6d01a837357d6c281f30ad30bc6d3183078c3b92 (diff)
downloadpylint-d8095acce29d9d77f7e00b4be4d1b6aaf9a6c7c3.tar.gz
Skip nodes with starargs or kwargs for now.
-rw-r--r--checkers/strings.py4
-rw-r--r--test/input/func_string_format_py27.py5
2 files changed, 8 insertions, 1 deletions
diff --git a/checkers/strings.py b/checkers/strings.py
index 2d8dce6..d5a312c 100644
--- a/checkers/strings.py
+++ b/checkers/strings.py
@@ -315,6 +315,10 @@ class StringMethodsChecker(BaseChecker):
strnode = func.bound.infer().next()
except astroid.InferenceError:
return
+ if node.starargs or node.kwargs:
+ # Don't complicate the logic, skip
+ # these for now.
+ return
try:
positional, named = get_args(node)
except astroid.InferenceError:
diff --git a/test/input/func_string_format_py27.py b/test/input/func_string_format_py27.py
index 458f462..868355f 100644
--- a/test/input/func_string_format_py27.py
+++ b/test/input/func_string_format_py27.py
@@ -1,6 +1,6 @@
"""test for Python 3 string formatting error
"""
-# pylint: disable=too-few-public-methods, import-error, unused-argument
+# pylint: disable=too-few-public-methods, import-error, unused-argument, star-args
import os
from missing import Missing
@@ -70,3 +70,6 @@ def pprint():
print "{pid}".format(pid=os.getpid())
print "{0.missing}".format(2)
print str("{}").format(2)
+ # these are skipped
+ print "{0} {1}".format(*[1, 2])
+ print "{a} {b}".format(**{'a': 1, 'b': 2})