Add Python 3.6 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:
Mikhail Golubev
2016-09-09 11:48:29 +03:00
parent 36cc57b236
commit c11850fa34
14 changed files with 1231 additions and 35 deletions
File diff suppressed because it is too large Load Diff
@@ -37,20 +37,10 @@ public enum LanguageLevel {
PYTHON32(32, true, false, true, true),
PYTHON33(33, true, false, true, true),
PYTHON34(34, true, false, true, true),
PYTHON35(35, true, false, true, true);
PYTHON35(35, true, false, true, true),
PYTHON36(36, true, false, true, true);
public static List<LanguageLevel> ALL_LEVELS = ImmutableList.<LanguageLevel>builder()
.add(PYTHON24)
.add(PYTHON25)
.add(PYTHON26)
.add(PYTHON27)
.add(PYTHON30)
.add(PYTHON31)
.add(PYTHON32)
.add(PYTHON33)
.add(PYTHON34)
.add(PYTHON35)
.build();
public static List<LanguageLevel> ALL_LEVELS = ImmutableList.copyOf(values());
private static final LanguageLevel DEFAULT2 = PYTHON27;
private static final LanguageLevel DEFAULT3 = PYTHON35;
@@ -143,6 +133,9 @@ public enum LanguageLevel {
if (pythonVersion.startsWith("3.5")) {
return PYTHON35;
}
if (pythonVersion.startsWith("3.6")) {
return PYTHON36;
}
return DEFAULT3;
}
return getDefault();
@@ -1,4 +1,4 @@
print(<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 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 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 do not support <>, use != instead.">a <> 2</warning>:
var = a
@@ -2,11 +2,11 @@ class A(B):
def __init__(self):
<warning descr="Python version 2.4, 2.5, 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 do not have method cmp">cmp()</warning>
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 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 2.4 does not have method all">all()</warning>
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 do not have method buffer">buffer()</warning>
def foo(a,b,c):
print (a,b,c)
@@ -5,5 +5,5 @@ try:
try:
do_smth()
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 do not support this syntax.">except ImportError, ImportWarning:
do()</warning>
@@ -1,8 +1,8 @@
<warning descr="Python version 2.4 doesn't support this syntax.">from . import smth</warning>
<warning descr="Python version 2.4 doesn't support this syntax.">from .module import name1, name2</warning>
from <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not have module Bastion">Bastion</warning> import BastionClass
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
<warning descr="Python version 2.4 doesn't support this syntax.">from . import exceptions</warning>
from <warning descr="Python version 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not have module email.Utils">email.Utils</warning> import formatdate
from <warning descr="Python version 2.5, 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
@@ -1 +1 @@
import <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 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.4, 2.5, 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 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 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 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 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 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 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 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>
@@ -1,6 +1,6 @@
try:
a
except :
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 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 do not support this syntax. Raise with no arguments can only be used in an except block">raise</warning>
<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 do not support this syntax. Raise with no arguments can only be used in an except block">raise</warning>
@@ -1 +1 @@
a = <warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 do not support backquotes, use repr() instead">`imp.acquire_lock()`</warning>
@@ -23,7 +23,7 @@ a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warn
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 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 do not support a 'UR' prefix">ur</warning>""
a = <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
a = <warning descr="Python version 2.4, 2.5, 3.0 do not support a 'BR' prefix">br</warning>""
@@ -31,12 +31,12 @@ a = <warning descr="Python version 2.4, 2.5, 3.0 do not support a 'BR' prefix">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 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 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>"" <warning descr="Python version 2.4, 2.5 do not support a 'B' prefix">b</warning>""
# never was available
a = <error descr="Python version 2.7 does not support a 'RR' prefix"><warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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.4, 2.5, 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.4, 2.5, 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.4, 2.5, 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>""
@@ -1 +1 @@
print(<warning descr="Python version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 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 do not support <>, use != instead.">a<caret> <> b</warning>)