mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY2 unicode-only type is something that is compatible with unicode (mypy rule) and not compatible with str
This commit is contained in:
+3
-1
@@ -285,7 +285,9 @@ public class ConvertFormatOperatorToMethodIntention extends PyBaseIntentionActio
|
||||
final PyType rhsType = context.getType(rhs);
|
||||
String prefix = "";
|
||||
final LanguageLevel languageLevel = guessLanguageLevel(project);
|
||||
if (!languageLevel.isPy3K() && PyTypeChecker.match(PyBuiltinCache.getInstance(rhs).getObjectType("unicode"), rhsType, context)) {
|
||||
final PyBuiltinCache builtinCache = PyBuiltinCache.getInstance(rhs);
|
||||
if (!languageLevel.isPy3K() && PyTypeChecker.match(builtinCache.getUnicodeType(languageLevel), rhsType, context) &&
|
||||
!PyTypeChecker.match(builtinCache.getBytesType(languageLevel), rhsType, context)) {
|
||||
prefix = "u";
|
||||
}
|
||||
final PyStringLiteralExpression leftExpression = (PyStringLiteralExpression)element.getLeftExpression();
|
||||
|
||||
Reference in New Issue
Block a user