mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Update usages for PyABCUtil.isSubclass and specify context where possible
This commit is contained in:
@@ -430,7 +430,7 @@ public class PyStringFormatInspection extends PyInspection {
|
||||
else {
|
||||
final PyClassType type = as(myTypeEvalContext.getType(rightExpression), PyClassType.class);
|
||||
if (type != null) {
|
||||
if (myUsedMappingKeys.size() > 0 && !PyABCUtil.isSubclass(type.getPyClass(), PyNames.MAPPING, null)) {
|
||||
if (myUsedMappingKeys.size() > 0 && !PyABCUtil.isSubclass(type.getPyClass(), PyNames.MAPPING, myTypeEvalContext)) {
|
||||
registerProblem(rightExpression, PyBundle.message("INSP.format.requires.mapping"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -107,11 +107,11 @@ public class PyABCUtil {
|
||||
final PyClassLikeType metaClassType = classType.getMetaClassType(context, true);
|
||||
if (metaClassType instanceof PyClassType) {
|
||||
final PyClassType metaClass = (PyClassType)metaClassType;
|
||||
return isSubclass(metaClass.getPyClass(), superClassName, true, null);
|
||||
return isSubclass(metaClass.getPyClass(), superClassName, true, context);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return isSubclass(pyClass, superClassName, true, null);
|
||||
return isSubclass(pyClass, superClassName, true, context);
|
||||
}
|
||||
}
|
||||
if (type instanceof PyUnionType) {
|
||||
|
||||
Reference in New Issue
Block a user