Fixed CCE in PythonDocumentationProvider (PY-7202)

This commit is contained in:
Andrey Vlasovskikh
2012-08-15 16:37:11 +04:00
parent 6d4632c681
commit b0974382fb
@@ -470,9 +470,12 @@ public class PythonDocumentationProvider extends AbstractDocumentationProvider i
@Nullable
private static PyClass inferClassOfParameter(PsiElement context) {
final PyType type = ((PyNamedParameter)context).getType(TypeEvalContext.fast());
if (type instanceof PyClassType)
return ((PyClassType)type).getPyClass();
if (context instanceof PyNamedParameter) {
final PyType type = ((PyNamedParameter)context).getType(TypeEvalContext.fast());
if (type instanceof PyClassType) {
return ((PyClassType)type).getPyClass();
}
}
return null;
}