mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
Add Python 3.7 language level
Additionally, I did the following: * re-generated lists of supported/unsupported interpreter modules * updated test data wherever Python versions appear in warnings Still need to figure out, though, why _bz2/bz2 modules were not found for some old versions of Python, hence information about their presense should be updated by hand in versions.xml.
This commit is contained in:
+468
-2660
File diff suppressed because it is too large
Load Diff
@@ -49,7 +49,8 @@ public enum LanguageLevel {
|
||||
PYTHON33(33, true, false, true, true),
|
||||
PYTHON34(34, true, false, true, true),
|
||||
PYTHON35(35, true, false, true, true),
|
||||
PYTHON36(36, true, false, true, true);
|
||||
PYTHON36(36, true, false, true, true),
|
||||
PYTHON37(37, true, false, true, true);
|
||||
|
||||
/**
|
||||
* @deprecated This field will be removed in 2018.2.
|
||||
@@ -61,7 +62,7 @@ public enum LanguageLevel {
|
||||
Collectors.toList())); // Python versions 2.4 and 2.5 aren't supported anymore
|
||||
|
||||
private static final LanguageLevel DEFAULT2 = PYTHON27;
|
||||
private static final LanguageLevel DEFAULT3 = PYTHON36;
|
||||
private static final LanguageLevel DEFAULT3 = PYTHON37;
|
||||
|
||||
public static LanguageLevel FORCE_LANGUAGE_LEVEL = null;
|
||||
|
||||
@@ -152,6 +153,9 @@ public enum LanguageLevel {
|
||||
if (pythonVersion.startsWith("3.6")) {
|
||||
return PYTHON36;
|
||||
}
|
||||
if (pythonVersion.startsWith("3.7")) {
|
||||
return PYTHON37;
|
||||
}
|
||||
return DEFAULT3;
|
||||
}
|
||||
return getDefault();
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.io.File
|
||||
*/
|
||||
object PyTypeShed {
|
||||
private val ONLY_SUPPORTED_PY2_MINOR = 7
|
||||
private val SUPPORTED_PY3_MINORS = 2..6
|
||||
private val SUPPORTED_PY3_MINORS = 2..7
|
||||
val WHITE_LIST = setOf(TYPING, "six", "__builtin__", "builtins", "exceptions", "types", "datetime")
|
||||
private val BLACK_LIST = setOf<String>()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
print(<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support <>, use != instead.">a <> b</warning>)
|
||||
print(<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support <>, use != instead.">a <> b</warning>)
|
||||
|
||||
if <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support <>, use != instead.">a <> 2</warning>:
|
||||
if <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support <>, use != instead.">a <> 2</warning>:
|
||||
var = a
|
||||
@@ -1 +1 @@
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have type long. Use int instead.">long("abc")</warning>
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not have type long. Use int instead.">long("abc")</warning>
|
||||
@@ -2,7 +2,7 @@ class A(B):
|
||||
def __init__(self):
|
||||
<warning descr="Python version 2.6, 2.7 do not support this syntax. super() should have arguments in Python 2">super()</warning>
|
||||
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have method cmp">cmp()</warning>
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have method reduce">reduce()</warning>
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not have method cmp">cmp()</warning>
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not have method reduce">reduce()</warning>
|
||||
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have method buffer">buffer()</warning>
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not have method buffer">buffer()</warning>
|
||||
@@ -1,4 +1,4 @@
|
||||
try:
|
||||
do_smth()
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax.">except ImportError, ImportWarning:
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support this syntax.">except ImportError, ImportWarning:
|
||||
do()</warning>
|
||||
@@ -1,3 +1 @@
|
||||
from <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have module Bastion">Bastion</warning> import BastionClass
|
||||
|
||||
from <warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have module email.Utils">email.Utils</warning> import formatdate
|
||||
from <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not have module Bastion">Bastion</warning> import BastionClass
|
||||
@@ -1 +1 @@
|
||||
import <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have module Bastion">Bastion</warning>
|
||||
import <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not have module Bastion">Bastion</warning>
|
||||
@@ -1,3 +1,3 @@
|
||||
<error descr="Python version 2.7 does not have module builtins"><warning descr="Python version 2.6, 2.7 do not have module builtins">import builtins</warning></error>
|
||||
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not have module __builtin__">import __builtin__</warning>
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not have module __builtin__">import __builtin__</warning>
|
||||
@@ -1 +1 @@
|
||||
var = [x for x in <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax in list comprehensions.">1, 2, 3</warning>]
|
||||
var = [x for x in <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support this syntax in list comprehensions.">1, 2, 3</warning>]
|
||||
@@ -1,2 +1,2 @@
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a trailing 'l' or 'L'.">12l</warning>
|
||||
v = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax. It requires '0o' prefix for octal literals">04</warning><error descr="End of statement expected">8</error>
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a trailing 'l' or 'L'.">12l</warning>
|
||||
v = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support this syntax. It requires '0o' prefix for octal literals">04</warning><error descr="End of statement expected">8</error>
|
||||
@@ -1,4 +1,4 @@
|
||||
try:
|
||||
a
|
||||
except :
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax.">raise ImportError, ImportWarning</warning>
|
||||
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support this syntax.">raise ImportError, ImportWarning</warning>
|
||||
|
||||
@@ -1 +1 @@
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support backquotes, use repr() instead">`imp.acquire_lock()`</warning>
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support backquotes, use repr() instead">`imp.acquire_lock()`</warning>
|
||||
|
||||
@@ -2,15 +2,15 @@ a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u<
|
||||
|
||||
# Python 3.6
|
||||
|
||||
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support a 'F' prefix">f</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support a 'F' prefix">F</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'RF' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support a 'RF' prefix">rf</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'FR' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support a 'FR' prefix">fr</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'FU' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'FU' prefix">fu</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'UF' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UF' prefix">uf</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'BF' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'BF' prefix">bf</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'FB' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'FB' prefix">fb</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'UFR' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UFR' prefix">ufr</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.7 do not support a 'F' prefix">f</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'F' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.7 do not support a 'F' prefix">F</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'RF' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.7 do not support a 'RF' prefix">rf</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'FR' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.7 do not support a 'FR' prefix">fr</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'FU' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'FU' prefix">fu</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'UF' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'UF' prefix">uf</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'BF' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'BF' prefix">bf</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'FB' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'FB' prefix">fb</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'UFR' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'UFR' prefix">ufr</warning></error>""
|
||||
|
||||
# python 3.3
|
||||
|
||||
@@ -35,7 +35,7 @@ a = b""
|
||||
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>""
|
||||
a = r""
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UR' prefix">ur</warning>""
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'UR' prefix">ur</warning>""
|
||||
a = b""
|
||||
a = <warning descr="Python version 3.0 does not support a 'BR' prefix">br</warning>""
|
||||
|
||||
@@ -43,12 +43,12 @@ a = <warning descr="Python version 3.0 does not support a 'BR' prefix">br</warni
|
||||
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>""
|
||||
a = r""
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UR' prefix">ur</warning>""
|
||||
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'UR' prefix">ur</warning>""
|
||||
|
||||
# combined
|
||||
b = <warning descr="Python version 3.0, 3.1, 3.2 do not support a 'U' prefix">u</warning>"" b""
|
||||
|
||||
# never was available
|
||||
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'RR' prefix">rr</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'BB' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'BB' prefix">bb</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'UU' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support a 'UU' prefix">uu</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'RR' prefix">rr</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'BB' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'BB' prefix">bb</warning></error>""
|
||||
a = <error descr="Python version 2.7 does not support a 'UU' prefix"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support a 'UU' prefix">uu</warning></error>""
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
# oct
|
||||
<warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">0o1_23</warning>
|
||||
<error descr="Python version 3.6 does not support this syntax. It requires '0o' prefix for octal literals"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals"><warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax. It requires '0o' prefix for octal literals">01_23</warning></warning></error>
|
||||
<error descr="Python version 3.6 does not support this syntax. It requires '0o' prefix for octal literals"><warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals"><warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support this syntax. It requires '0o' prefix for octal literals">01_23</warning></warning></error>
|
||||
|
||||
# bin
|
||||
<warning descr="Python version 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support underscores in numeric literals">0b_0011_1111_0100_1110</warning>
|
||||
|
||||
@@ -1 +1 @@
|
||||
print(<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support <>, use != instead.">a<caret> <> b</warning>)
|
||||
print(<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 do not support <>, use != instead.">a<caret> <> b</warning>)
|
||||
Reference in New Issue
Block a user