check-code: un-ban any() now that we're on 2.6

This commit is contained in:
Augie Fackler 2015-05-16 14:31:03 -04:00
parent be44b12d03
commit 8135f8f3bf
2 changed files with 7 additions and 14 deletions

View File

@ -243,8 +243,8 @@ pypats = [
# (r'^\s*print\s+', "avoid using print in core and extensions"),
(r'[\x80-\xff]', "non-ASCII character literal"),
(r'("\')\.format\(', "str.format() not available in Python 2.4"),
(r'(?<!def)\s+(any|all|format)\(',
"any/all/format not available in Python 2.4", 'no-py24'),
(r'(?<!def)\s+(all|format)\(',
"all/format not available in Python 2.4", 'no-py24'),
(r'if\s.*\selse', "if ... else form not available in Python 2.4"),
(r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist),
"gratuitous whitespace after Python keyword"),

View File

@ -19,14 +19,10 @@
> EOF
$ cat > non-py24.py <<EOF
> # Using builtins that does not exist in Python 2.4
> if any():
> if True:
> x = all()
> y = format(x)
>
> # Do not complain about our own definition
> def any(x):
> pass
>
> # try/except/finally block does not exist in Python 2.4
> try:
> pass
@ -85,19 +81,16 @@
./quote.py:5:
> '"""', 42+1, """and
missing whitespace in expression
./non-py24.py:2:
> if any():
any/all/format not available in Python 2.4
./non-py24.py:3:
> x = all()
any/all/format not available in Python 2.4
all/format not available in Python 2.4
./non-py24.py:4:
> y = format(x)
any/all/format not available in Python 2.4
./non-py24.py:28:
all/format not available in Python 2.4
./non-py24.py:24:
> try:
no yield inside try/finally in Python 2.4
./non-py24.py:33:
./non-py24.py:29:
> try:
no yield inside try/finally in Python 2.4
./classstyle.py:4: