From 5e59e9281dee78771aa97e34c4d7932617ba75dc Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Wed, 6 Jul 2016 20:10:50 +0300 Subject: [PATCH] Update usages for PyABCUtil.isSubclass and specify context where possible --- .../python/inspections/PyStringFormatInspection.java | 2 +- python/src/com/jetbrains/python/psi/types/PyABCUtil.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/src/com/jetbrains/python/inspections/PyStringFormatInspection.java b/python/src/com/jetbrains/python/inspections/PyStringFormatInspection.java index e7e3a3fb84ff..c1f61a726362 100644 --- a/python/src/com/jetbrains/python/inspections/PyStringFormatInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyStringFormatInspection.java @@ -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; } diff --git a/python/src/com/jetbrains/python/psi/types/PyABCUtil.java b/python/src/com/jetbrains/python/psi/types/PyABCUtil.java index eaea98510c32..fc6d2ef0d831 100644 --- a/python/src/com/jetbrains/python/psi/types/PyABCUtil.java +++ b/python/src/com/jetbrains/python/psi/types/PyABCUtil.java @@ -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) {