Revert "Special case typing for Python < 3.5 (PY-22945)"

This reverts commit 891b423d16.

Don't disable resolve to typing because stubs would become useless.
This commit is contained in:
Semyon Proshev
2017-12-29 15:38:17 +03:00
parent e2a491e37c
commit 03c7843ae3
2 changed files with 7 additions and 4 deletions
@@ -57,11 +57,7 @@ object PyTypeShed {
return false
}
if (isInStandardLibrary(root)) {
if (ApplicationManager.getApplication().isUnitTestMode ||
topLevelPackage != TYPING ||
PythonSdkType.getLanguageLevelForSdk(sdk).isAtLeast(LanguageLevel.PYTHON35)) {
return true
}
}
if (isInThirdPartyLibraries(root)) {
if (ApplicationManager.getApplication().isUnitTestMode) {
@@ -2587,6 +2587,13 @@ public class PyTypeTest extends PyTestCase {
);
}
// PY-22945
public void testNotInstalledTypingUsedInAnalysis() {
doTest("Pattern[str]",
"from re import compile\n" +
"expr = compile(\"str\")");
}
private static List<TypeEvalContext> getTypeEvalContexts(@NotNull PyExpression element) {
return ImmutableList.of(TypeEvalContext.codeAnalysis(element.getProject(), element.getContainingFile()).withTracing(),
TypeEvalContext.userInitiated(element.getProject(), element.getContainingFile()).withTracing());