mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user