Fix PY-19699 False positive "Too few arguments for format string" on *imported* tuple: don't inspect expression with not-inferred type

This commit is contained in:
Valentina Kiryushkina
2017-05-15 14:37:53 +03:00
parent 91f27172ee
commit 26db023a9c
@@ -219,7 +219,8 @@ public class PyStringFormatInspection extends PyInspection {
final PyType stringType = PyBuiltinCache.getInstance(rightExpression).getStringType(LanguageLevel.forElement(rightExpression));
final PyType listType = PyBuiltinCache.getInstance(rightExpression).getListType();
if (type == null || PyTypeChecker.match(listType, type, myTypeEvalContext)
if (type == null) return -1;
if (PyTypeChecker.match(listType, type, myTypeEvalContext)
|| PyTypeChecker.match(stringType, type, myTypeEvalContext)) {
checkTypeCompatible(problemTarget, builtinCache.getStrType(),
PyTypeParser.getTypeByName(problemTarget, s));