Update usages for PyABCUtil.isSubclass and specify context where possible

This commit is contained in:
Semyon Proshev
2016-07-14 18:56:13 +03:00
parent 414b6f1f90
commit 5e59e9281d
2 changed files with 3 additions and 3 deletions
@@ -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) {